-
Notifications
You must be signed in to change notification settings - Fork 222
Expand file tree
/
Copy pathMtpTestCase.cs
More file actions
41 lines (33 loc) · 1.18 KB
/
MtpTestCase.cs
File metadata and controls
41 lines (33 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Diagnostics.CodeAnalysis;
using Stryker.Abstractions.Testing;
namespace Stryker.TestRunner.MicrosoftTestPlatform.Models;
[ExcludeFromCodeCoverage]
public sealed class MtpTestCase : ITestCase
{
private readonly TestNode _testNode;
public MtpTestCase(TestNode testNode)
{
_testNode = testNode;
CodeFilePath = testNode.LocationFile ?? string.Empty;
LineNumber = testNode.LocationLineStart ?? 0;
FullyQualifiedName = BuildFullyQualifiedName(testNode);
}
public string FullyQualifiedName { get; }
public Uri Uri => new("executor://MicrosoftTestPlatform");
public int LineNumber { get; }
public string Source { get; }
public string CodeFilePath { get; }
public string AssemblyPath { get; init; }
public Guid Guid { get; }
public string Name => _testNode.DisplayName;
public string Id => _testNode.Uid;
private static string BuildFullyQualifiedName(TestNode testNode)
{
if (testNode.LocationType is not null && testNode.LocationMethod is not null)
{
return $"{testNode.LocationType}.{testNode.LocationMethod}";
}
return testNode.Uid;
}
}