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 22// Licensed under the MIT license. See LICENSE file in the project root for full license information.
33
44#if ! WINDOWS_UWP
5+ using System . Reflection ;
6+
57using Microsoft . Testing . Platform . Extensions ;
68
79namespace Microsoft . VisualStudio . TestTools . UnitTesting ;
810
911internal sealed class MSTestExtension : IExtension
1012{
11- public string Uid => nameof ( MSTestExtension ) ;
13+ public string Uid { get ; } = GetExtensionUid ( ) ;
1214
1315 public string DisplayName => "MSTest" ;
1416
@@ -17,5 +19,11 @@ internal sealed class MSTestExtension : IExtension
1719 public string Description => "MSTest Framework for Microsoft Testing Platform" ;
1820
1921 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+ }
2028}
2129#endif
Original file line number Diff line number Diff line change 2626 <MicrosoftTestingExtensionsCodeCoverageVersion Condition =" '$(MicrosoftTestingExtensionsCodeCoverageVersion)' == '' " >$(MicrosoftTestingExtensionsCodeCoverageVersion)</MicrosoftTestingExtensionsCodeCoverageVersion >
2727 </PropertyGroup >
2828
29+ <ItemGroup >
30+ <AssemblyMetadata Include =" MSTest.Extension.Uid" Value =" MSTest.Sdk" />
31+ </ItemGroup >
32+
2933</Project >
You can’t perform that action at this time.
0 commit comments