Skip to content

Commit 5c99167

Browse files
committed
Remove no longer relevant tests
1 parent 795b23f commit 5c99167

File tree

2 files changed

+0
-115
lines changed

2 files changed

+0
-115
lines changed

test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/TypeCacheTests.cs

Lines changed: 0 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -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()

test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Execution/UnitTestRunnerTests.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -109,30 +109,6 @@ public async Task RunSingleTestShouldReturnTestResultIndicateATestNotFoundIfTest
109109
results[0].IgnoreReason.Should().Be("Test method M was not found.");
110110
}
111111

112-
public async Task RunSingleTestShouldReturnTestResultIndicatingNotRunnableTestIfTestMethodCannotBeRun()
113-
{
114-
Type type = typeof(TypeCacheTests.DummyTestClassWithTestMethods);
115-
MethodInfo methodInfo = type.GetMethod("TestMethodWithNullCustomPropertyName")!;
116-
TestMethod testMethod = CreateTestMethod(methodInfo.Name, type.FullName!, "A", displayName: null);
117-
118-
_testablePlatformServiceProvider.MockFileOperations.Setup(fo => fo.LoadAssembly("A"))
119-
.Returns(Assembly.GetExecutingAssembly());
120-
121-
UnitTestRunner unitTestRunner = CreateUnitTestRunner([new UnitTestElement(testMethod)]);
122-
TestResult[] results = await unitTestRunner.RunSingleTestAsync(testMethod, _testRunParameters, null!);
123-
124-
string expectedMessage = string.Format(
125-
CultureInfo.InvariantCulture,
126-
"UTA021: {0}: Null or empty custom property defined on method {1}. The custom property must have a valid name.",
127-
methodInfo.DeclaringType!.FullName,
128-
methodInfo.Name);
129-
130-
results.Should().NotBeNull();
131-
results.Length.Should().Be(1);
132-
results[0].Outcome.Should().Be(UTF.UnitTestOutcome.NotRunnable);
133-
results[0].IgnoreReason.Should().Be(expectedMessage);
134-
}
135-
136112
public async Task ExecuteShouldSkipTestAndFillInClassIgnoreMessageIfIgnoreAttributeIsPresentOnTestClassAndHasMessage()
137113
{
138114
Type type = typeof(TypeCacheTests.DummyTestClassWithIgnoreClassWithMessage);

0 commit comments

Comments
 (0)