Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using Microsoft.TestPlatform.AdapterUtilities;
using Microsoft.TestPlatform.AdapterUtilities.ManagedNameUtilities;
using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Extensions;
using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.Helpers;
using Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.ObjectModel;
using Microsoft.VisualStudio.TestTools.UnitTesting;
Expand Down Expand Up @@ -138,8 +137,6 @@ internal UnitTestElement GetTestFromMethod(MethodInfo method, ICollection<string

var testElement = new UnitTestElement(testMethod)
{
// Get compiler generated type name for async test method (either void returning or task returning).
AsyncTypeName = method.GetAsyncTypeName(),
TestCategory = _reflectHelper.GetTestCategories(method, _type),
DoNotParallelize = _reflectHelper.IsDoNotParallelizeSet(method, _type),
Priority = _reflectHelper.GetPriority(method),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ public UnitTestElement(TestMethod testMethod)

internal int? DeclaringLineNumber { get; set; }

/// <summary>
/// Gets or sets the compiler generated type name for async test method.
/// </summary>
internal string? AsyncTypeName { get; set; }

/// <summary>
/// Gets or sets the Work Item Ids for the test method.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,20 +275,6 @@ public void GetTestFromMethodShouldInitiateTestMethodWithCorrectParameters()
Verify(testElement.TestMethod.AssemblyName == "DummyAssemblyName");
}

public void GetTestFromMethodShouldInitializeAsyncTypeNameCorrectly()
{
SetupTestClassAndTestMethods(isValidTestClass: true, isValidTestMethod: true, isMethodFromSameAssembly: true);
TypeEnumerator typeEnumerator = GetTypeEnumeratorInstance(typeof(DummyTestClass), "DummyAssemblyName");
MethodInfo methodInfo = typeof(DummyTestClass).GetMethod("AsyncMethodWithTaskReturnType")!;

MSTest.TestAdapter.ObjectModel.UnitTestElement testElement = typeEnumerator.GetTestFromMethod(methodInfo, _warnings);

string? expectedAsyncTaskName = methodInfo.GetCustomAttribute<AsyncStateMachineAttribute>()!.StateMachineType.FullName;

Verify(testElement is not null);
Verify(expectedAsyncTaskName == testElement.AsyncTypeName);
}

public void GetTestFromMethodShouldSetTestCategory()
{
SetupTestClassAndTestMethods(isValidTestClass: true, isValidTestMethod: true, isMethodFromSameAssembly: true);
Expand Down
Loading