@@ -998,79 +998,6 @@ public void GetTestMethodInfoShouldReturnTestMethodInfoForMethodsAdornedWithADer
998998 testMethodInfo . Executor . Should ( ) . BeOfType < DerivedTestMethodAttribute > ( ) ;
999999 }
10001000
1001- public void GetTestMethodInfoShouldSetTestContextWithCustomProperty ( )
1002- {
1003- // Not using _typeCache here which uses a mocked ReflectHelper which doesn't work well with this test.
1004- // Setting up the mock feels unnecessary when the original production implementation can work just fine.
1005- var typeCache = new TypeCache ( new ReflectHelper ( ) ) ;
1006- Type type = typeof ( DummyTestClassWithTestMethods ) ;
1007- MethodInfo methodInfo = type . GetMethod ( "TestMethodWithCustomProperty" ) ! ;
1008- TestMethod testMethod = CreateTestMethod ( methodInfo . Name , type . FullName ! , "A" , displayName : null ) ;
1009-
1010- TestContextImplementation testContext = CreateTestContextImplementationForMethod ( testMethod ) ;
1011-
1012- typeCache . GetTestMethodInfo ( testMethod , testContext ) ;
1013- KeyValuePair < string , object ? > customProperty = testContext . Properties . FirstOrDefault ( p => p . Key . Equals ( "WhoAmI" , StringComparison . Ordinal ) ) ;
1014-
1015- customProperty . Should ( ) . NotBeNull ( ) ;
1016- ( customProperty . Value as string ) . Should ( ) . Be ( "Me" ) ;
1017- }
1018-
1019- public void GetTestMethodInfoShouldAllowActualOwnerAttribute ( )
1020- {
1021- // Test that the actual OwnerAttribute is allowed
1022- var typeCache = new TypeCache ( new ReflectHelper ( ) ) ;
1023- Type type = typeof ( DummyTestClassWithTestMethods ) ;
1024- MethodInfo methodInfo = type . GetMethod ( "TestMethodWithActualOwnerAttribute" ) ! ;
1025- TestMethod testMethod = CreateTestMethod ( methodInfo . Name , type . FullName ! , "A" , displayName : null ) ;
1026- TestContextImplementation testContext = CreateTestContextImplementationForMethod ( testMethod ) ;
1027-
1028- TestMethodInfo ? testMethodInfo = typeCache . GetTestMethodInfo ( testMethod , testContext ) ;
1029-
1030- testMethodInfo . Should ( ) . NotBeNull ( ) ;
1031-
1032- // The Owner property should be added to the test context
1033- testContext . TryGetPropertyValue ( "Owner" , out object ? ownerValue ) . Should ( ) . BeTrue ( ) ;
1034- ownerValue ? . ToString ( ) . Should ( ) . Be ( "TestOwner" ) ;
1035- }
1036-
1037- public void GetTestMethodInfoShouldAllowActualPriorityAttribute ( )
1038- {
1039- // Test that the actual PriorityAttribute is allowed
1040- var typeCache = new TypeCache ( new ReflectHelper ( ) ) ;
1041- Type type = typeof ( DummyTestClassWithTestMethods ) ;
1042- MethodInfo methodInfo = type . GetMethod ( "TestMethodWithActualPriorityAttribute" ) ! ;
1043- TestMethod testMethod = CreateTestMethod ( methodInfo . Name , type . FullName ! , "A" , displayName : null ) ;
1044- TestContextImplementation testContext = CreateTestContextImplementationForMethod ( testMethod ) ;
1045-
1046- TestMethodInfo ? testMethodInfo = typeCache . GetTestMethodInfo ( testMethod , testContext ) ;
1047-
1048- testMethodInfo . Should ( ) . NotBeNull ( ) ;
1049-
1050- // The Priority property should be added to the test context
1051- testContext . TryGetPropertyValue ( "Priority" , out object ? priorityValue ) . Should ( ) . BeTrue ( ) ;
1052- priorityValue ? . ToString ( ) . Should ( ) . Be ( "1" ) ;
1053- }
1054-
1055- public void GetTestMethodInfoShouldNotAddDuplicateTestPropertiesToTestContext ( )
1056- {
1057- // Not using _typeCache here which uses a mocked ReflectHelper which doesn't work well with this test.
1058- // Setting up the mock feels unnecessary when the original production implementation can work just fine.
1059- var typeCache = new TypeCache ( new ReflectHelper ( ) ) ;
1060- Type type = typeof ( DummyTestClassWithTestMethods ) ;
1061- MethodInfo methodInfo = type . GetMethod ( "TestMethodWithDuplicateCustomPropertyNames" ) ! ;
1062- TestMethod testMethod = CreateTestMethod ( methodInfo . Name , type . FullName ! , "A" , displayName : null ) ;
1063- TestContextImplementation testContext = CreateTestContextImplementationForMethod ( testMethod ) ;
1064-
1065- TestMethodInfo ? testMethodInfo = typeCache . GetTestMethodInfo ( testMethod , testContext ) ;
1066-
1067- testMethodInfo . Should ( ) . NotBeNull ( ) ;
1068-
1069- // Verify that the first value gets set.
1070- testContext . Properties . TryGetValue ( "WhoAmI" , out object ? value ) . Should ( ) . BeTrue ( ) ;
1071- value . Should ( ) . Be ( "Me" ) ;
1072- }
1073-
10741001 public void GetTestMethodInfoShouldReturnTestMethodInfoForDerivedTestClasses ( )
10751002 {
10761003 Type type = typeof ( DerivedTestClass ) ;
@@ -1275,12 +1202,6 @@ public void TestMethodWithTimeoutOfZero()
12751202 {
12761203 }
12771204
1278- [ TestMethod ]
1279- [ TestProperty ( "WhoAmI" , "Me" ) ]
1280- public void TestMethodWithCustomProperty ( )
1281- {
1282- }
1283-
12841205 [ TestMethod ]
12851206 [ TestProperty ( "Owner" , "You" ) ]
12861207 public void TestMethodWithOwnerAsCustomProperty ( )
@@ -1293,18 +1214,6 @@ public void TestMethodWithTestCategoryAsCustomProperty()
12931214 {
12941215 }
12951216
1296- [ TestMethod ]
1297- [ Owner ( "TestOwner" ) ]
1298- public void TestMethodWithActualOwnerAttribute ( )
1299- {
1300- }
1301-
1302- [ TestMethod ]
1303- [ Priority ( 1 ) ]
1304- public void TestMethodWithActualPriorityAttribute ( )
1305- {
1306- }
1307-
13081217 [ TestMethod ]
13091218 [ TestProperty ( "Priority" , "2" ) ]
13101219 public void TestMethodWithPriorityAsCustomProperty ( )
0 commit comments