Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CreateSceneAttribute #15

Merged
merged 2 commits into from
Oct 22, 2023
Merged

Conversation

nowsprinting
Copy link
Owner

@nowsprinting nowsprinting commented Oct 22, 2023

CreateSceneAttribute is an NUnit test attribute class to create new scene before running test.

This attribute can attached to test method only.

Usage:

using System;
using NUnit.Framework;
using TestHelper.Attributes;

[TestFixture]
public class MyTestClass
{
    [Test]
    [CreateScene]
    public void MyTestMethod(camera: true, light: true)
    {
        var camera = GameObject.Find("Main Camera");
        Assert.That(camera, Is.Not.Null);
    }
}

Note

  • Create scene run after OneTimeSetUp and before SetUp
  • Create or not Main Camera and Directional Light can be specified with parameters (default is not create)

@github-actions github-actions bot added the enhancement New feature or request label Oct 22, 2023
@github-actions

This comment has been minimized.

@github-actions
Copy link

Code Metrics Report

master (d82dd8e) #15 (db4458c) +/-
Coverage 49.5% 54.2% +4.7%
Code to Test Ratio 1:0.8 1:0.9 +0.0
Test Execution Time 3m55s 5m7s +1m12s
Details
  |                     | master (d82dd8e) | #15 (db4458c) |  +/-   |
  |---------------------|------------------|---------------|--------|
+ | Coverage            |            49.5% |         54.2% |  +4.7% |
  |   Files             |               16 |            17 |     +1 |
  |   Lines             |              404 |           445 |    +41 |
+ |   Covered           |              200 |           241 |    +41 |
+ | Code to Test Ratio  |            1:0.8 |         1:0.9 |   +0.0 |
  |   Code              |              738 |           811 |    +73 |
+ |   Test              |              609 |           703 |    +94 |
- | Test Execution Time |            3m55s |          5m7s | +1m12s |

Code coverage of files in pull request scope (0.0% → 100.0%)

Files Coverage +/-
Runtime/Attributes/CreateSceneAttribute.cs 100.0% +100.0%

Reported by octocov

@nowsprinting nowsprinting merged commit 19f6103 into master Oct 22, 2023
8 checks passed
@nowsprinting nowsprinting deleted the feature/createsceneattribute branch October 22, 2023 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant