File tree Expand file tree Collapse file tree
nunit.engine.core.tests/Drivers
nunit.engine.core/Drivers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- next-version : 3.14 .0
1+ next-version : 4.0 .0
22mode : ContinuousDelivery
33legacy-semver-padding : 5
44build-metadata-padding : 5
Original file line number Diff line number Diff line change 1+ // Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt
2+
3+ using NUnit . Engine . Drivers ;
4+ using NUnit . Framework ;
5+ using System ;
6+ using System . Reflection ;
7+
8+ namespace NUnit . Engine . Tests . Drivers
9+ {
10+ public class NUnit3DriverFactoryTests
11+ {
12+ private NUnit3DriverFactory _factory ;
13+
14+ [ SetUp ]
15+ public void SetUp ( )
16+ {
17+ _factory = new NUnit3DriverFactory ( ) ;
18+ }
19+
20+ [ TestCase ( 2 , ExpectedResult = false ) ]
21+ [ TestCase ( 3 , ExpectedResult = true ) ]
22+ [ TestCase ( 4 , ExpectedResult = true ) ]
23+ public bool SupportsNetFramework ( int majorVersion )
24+ {
25+ AssemblyName name = new AssemblyName ( NUnit3DriverFactory . NUNIT_FRAMEWORK )
26+ {
27+ Version = new Version ( majorVersion , 0 )
28+ } ;
29+
30+ return _factory . IsSupportedTestFramework ( name ) ;
31+ }
32+
33+ [ Test ]
34+ public void DoesNotSupportOtherFrameworks ( )
35+ {
36+ AssemblyName name = new AssemblyName ( "VSTest.dll" )
37+ {
38+ Version = new Version ( 3 , 0 )
39+ } ;
40+
41+ Assert . That ( _factory . IsSupportedTestFramework ( name ) , Is . False ) ;
42+ }
43+ }
44+ }
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ namespace NUnit.Engine.Drivers
1010{
1111 public class NUnit3DriverFactory : IDriverFactory
1212 {
13- private const string NUNIT_FRAMEWORK = "nunit.framework" ;
13+ internal const string NUNIT_FRAMEWORK = "nunit.framework" ;
1414 static ILogger log = InternalTrace . GetLogger ( typeof ( NUnit3DriverFactory ) ) ;
1515
1616 /// <summary>
@@ -20,7 +20,7 @@ public class NUnit3DriverFactory : IDriverFactory
2020 /// <param name="reference">An AssemblyName referring to the possible test framework.</param>
2121 public bool IsSupportedTestFramework ( AssemblyName reference )
2222 {
23- return NUNIT_FRAMEWORK . Equals ( reference . Name , StringComparison . OrdinalIgnoreCase ) && reference . Version . Major = = 3 ;
23+ return NUNIT_FRAMEWORK . Equals ( reference . Name , StringComparison . OrdinalIgnoreCase ) && reference . Version . Major > = 3 ;
2424 }
2525
2626#if NETFRAMEWORK
You can’t perform that action at this time.
0 commit comments