Skip to content

Commit

Permalink
fix: make id unique by fully qualified test name (#115)
Browse files Browse the repository at this point in the history
bianyifan authored May 11, 2023
1 parent 4e56fc4 commit a5fef0b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/yunit/TestAdapter.cs
Original file line number Diff line number Diff line change
@@ -219,14 +219,15 @@ private static TestCase CreateTestCase(TestData data, Type type, MethodInfo meth
: $"{Path.GetFileName(data.FilePath)}/{data.Ordinal:D2}: [{data.Matrix}] {data.Summary}";

var displayNameHash = Convert.ToBase64String(Encoding.UTF8.GetBytes(displayName));
var fullyQualifiedName = $"{type.FullName}.{method.Name}({attributeIndex},{displayNameHash})";

var result = new TestCase
{
LocalExtensionData = data,
FullyQualifiedName = $"{type.FullName}.{method.Name}({displayNameHash})",
FullyQualifiedName = fullyQualifiedName,
Source = source,
ExecutorUri = new Uri("executor://yunit"),
Id = CreateGuid($"{attributeIndex}/{displayName}"),
Id = CreateGuid(fullyQualifiedName),
DisplayName = displayName,
CodeFilePath = data.FilePath,
LineNumber = data.LineNumber,

0 comments on commit a5fef0b

Please sign in to comment.