Skip to content

Commit 72ee692

Browse files
authored
Remove unused property in UnitTestElement (#6740)
1 parent 0b247e3 commit 72ee692

File tree

3 files changed

+0
-22
lines changed

3 files changed

+0
-22
lines changed

src/Adapter/MSTestAdapter.PlatformServices/Discovery/TypeEnumerator.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
using Microsoft.TestPlatform.AdapterUtilities;
55
using Microsoft.TestPlatform.AdapterUtilities.ManagedNameUtilities;
6-
using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions;
76
using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers;
87
using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel;
98
using Microsoft.VisualStudio.TestTools.UnitTesting;
@@ -138,8 +137,6 @@ internal UnitTestElement GetTestFromMethod(MethodInfo method, ICollection<string
138137

139138
var testElement = new UnitTestElement(testMethod)
140139
{
141-
// Get compiler generated type name for async test method (either void returning or task returning).
142-
AsyncTypeName = method.GetAsyncTypeName(),
143140
TestCategory = _reflectHelper.GetTestCategories(method, _type),
144141
DoNotParallelize = _reflectHelper.IsDoNotParallelizeSet(method, _type),
145142
Priority = _reflectHelper.GetPriority(method),

src/Adapter/MSTestAdapter.PlatformServices/ObjectModel/UnitTestElement.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,6 @@ public UnitTestElement(TestMethod testMethod)
7575

7676
internal int? DeclaringLineNumber { get; set; }
7777

78-
/// <summary>
79-
/// Gets or sets the compiler generated type name for async test method.
80-
/// </summary>
81-
internal string? AsyncTypeName { get; set; }
82-
8378
/// <summary>
8479
/// Gets or sets the Work Item Ids for the test method.
8580
/// </summary>

test/UnitTests/MSTestAdapter.PlatformServices.UnitTests/Discovery/TypeEnumeratorTests.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -275,20 +275,6 @@ public void GetTestFromMethodShouldInitiateTestMethodWithCorrectParameters()
275275
Verify(testElement.TestMethod.AssemblyName == "DummyAssemblyName");
276276
}
277277

278-
public void GetTestFromMethodShouldInitializeAsyncTypeNameCorrectly()
279-
{
280-
SetupTestClassAndTestMethods(isValidTestClass: true, isValidTestMethod: true, isMethodFromSameAssembly: true);
281-
TypeEnumerator typeEnumerator = GetTypeEnumeratorInstance(typeof(DummyTestClass), "DummyAssemblyName");
282-
MethodInfo methodInfo = typeof(DummyTestClass).GetMethod("AsyncMethodWithTaskReturnType")!;
283-
284-
MSTest.TestAdapter.ObjectModel.UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, _warnings);
285-
286-
string? expectedAsyncTaskName = methodInfo.GetCustomAttribute<AsyncStateMachineAttribute>()!.StateMachineType.FullName;
287-
288-
Verify(testElement is not null);
289-
Verify(expectedAsyncTaskName == testElement.AsyncTypeName);
290-
}
291-
292278
public void GetTestFromMethodShouldSetTestCategory()
293279
{
294280
SetupTestClassAndTestMethods(isValidTestClass: true, isValidTestMethod: true, isMethodFromSameAssembly: true);

0 commit comments

Comments
 (0)