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 UnityVersionAttribute #75

Merged
merged 2 commits into from
Apr 30, 2024
Merged

Add UnityVersionAttribute #75

merged 2 commits into from
Apr 30, 2024

Conversation

nowsprinting
Copy link
Owner

UnityVersionAttribute is an NUnit test attribute class to skip test run if Unity version is older and/or newer than specified.

Usage:

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

[TestFixture]
public class MyTestClass
{
    [Test]
    [UnityVersion(newerThanOrEqual: "2022")]
    public void MyTestMethod()
    {
        // Test run only for Unity 2022.1.0f1 or later.
    }

    [Test]
    [UnityVersion(olderThan: "2019.4.0f1")]
    public void MyTestMethod()
    {
        // Test run only for Unity older than 2019.4.0f1.
    }
}

Copy link

Code Metrics Report

master (fad6d14) #75 (7dd5788) +/-
Coverage 71.5% 71.6% +0.2%
Code to Test Ratio 1:0.9 1:1.0 +0.0
Details
  |                    | master (fad6d14) | #75 (7dd5788) |  +/-  |
  |--------------------|------------------|---------------|-------|
+ | Coverage           |            71.5% |         71.6% | +0.2% |
  |   Files            |               26 |            27 |    +1 |
  |   Lines            |              617 |           645 |   +28 |
+ |   Covered          |              441 |           462 |   +21 |
+ | Code to Test Ratio |            1:0.9 |         1:1.0 |  +0.0 |
  |   Code             |             1211 |          1259 |   +48 |
+ |   Test             |             1141 |          1202 |   +61 |

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

Files Coverage +/-
Runtime/Attributes/UnityVersionAttribute.cs 75.0% +75.0%

Reported by octocov

@nowsprinting nowsprinting added the enhancement New feature or request label Apr 30, 2024
@nowsprinting nowsprinting merged commit 38d52cc into master Apr 30, 2024
9 checks passed
@nowsprinting nowsprinting deleted the ignoreunityversion branch April 30, 2024 06:46
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