File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Adapter/MSTest.TestAdapter/TestingPlatformAdapter
Package/MSTest.Sdk/Sdk/Runner Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 2
2
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
3
4
4
#if ! WINDOWS_UWP
5
+ using System . Reflection ;
6
+
5
7
using Microsoft . Testing . Platform . Extensions ;
6
8
7
9
namespace Microsoft . VisualStudio . TestTools . UnitTesting ;
8
10
9
11
internal sealed class MSTestExtension : IExtension
10
12
{
11
- public string Uid => nameof ( MSTestExtension ) ;
13
+ public string Uid { get ; } = GetExtensionUid ( ) ;
12
14
13
15
public string DisplayName => "MSTest" ;
14
16
@@ -17,5 +19,11 @@ internal sealed class MSTestExtension : IExtension
17
19
public string Description => "MSTest Framework for Microsoft Testing Platform" ;
18
20
19
21
public Task < bool > IsEnabledAsync ( ) => Task . FromResult ( true ) ;
22
+
23
+ private static string GetExtensionUid ( )
24
+ {
25
+ var assemblyMetadataAttributes = Assembly . GetEntryAssembly ( ) ? . GetCustomAttributes < AssemblyMetadataAttribute > ( ) ;
26
+ return assemblyMetadataAttributes ? . FirstOrDefault ( x => x . Key == "MSTest.Extension.Uid" ) ? . Value ?? nameof ( MSTestExtension ) ;
27
+ }
20
28
}
21
29
#endif
Original file line number Diff line number Diff line change 26
26
<MicrosoftTestingExtensionsCodeCoverageVersion Condition =" '$(MicrosoftTestingExtensionsCodeCoverageVersion)' == '' " >$(MicrosoftTestingExtensionsCodeCoverageVersion)</MicrosoftTestingExtensionsCodeCoverageVersion >
27
27
</PropertyGroup >
28
28
29
+ <ItemGroup >
30
+ <AssemblyMetadata Include =" MSTest.Extension.Uid" Value =" MSTest.Sdk" />
31
+ </ItemGroup >
32
+
29
33
</Project >
You can’t perform that action at this time.
0 commit comments