Skip to content

Commit bab1013

Browse files
author
MITEK\mkoning
committed
Merge remote-tracking branch 'refs/remotes/OpenCoverUI/master'
2 parents d08737f + b3ee62f commit bab1013

File tree

14 files changed

+62
-195
lines changed

14 files changed

+62
-195
lines changed

.nuget/NuGet.Config

Lines changed: 0 additions & 6 deletions
This file was deleted.

.nuget/NuGet.exe

-1.59 MB
Binary file not shown.

.nuget/NuGet.targets

Lines changed: 0 additions & 144 deletions
This file was deleted.

OpenCover.UI.Framework/OpenCover.UI.Framework.csproj

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,6 @@
7676
<None Include="packages.config" />
7777
</ItemGroup>
7878
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
79-
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
80-
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
81-
<PropertyGroup>
82-
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
83-
</PropertyGroup>
84-
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
85-
</Target>
8679
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
8780
Other similar extension points exist, see Microsoft.Common.targets.
8881
<Target Name="BeforeBuild">
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
3+
namespace OpenCover.UI.TestDiscoverer.TestResources.MSTest
4+
{
5+
[TestClass]
6+
public class TestFixtureWithTraits
7+
{
8+
[TestMethod]
9+
[TestCategory("Category_TestMethod_TestFixtureWithTraits")]
10+
public void TestMethod_TestFixtureWithTraits()
11+
{
12+
13+
}
14+
}
15+
16+
[TestClass]
17+
public class TestFixtureInheritingTraitMethods : TestFixtureWithTraits
18+
{
19+
[TestMethod]
20+
[TestCategory("Category_TestMethod_TestFixtureInheritingTraitMethods_1")]
21+
[TestCategory("Category_TestMethod_TestFixtureInheritingTraitMethods_2")]
22+
public void TestMethod_TestFixtureInheritingTraitMethods()
23+
{
24+
25+
}
26+
}
27+
}

OpenCover.UI.TestDiscoverer.TestResources/OpenCover.UI.TestDiscoverer.TestResources.csproj

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
</ItemGroup>
6969
<ItemGroup>
7070
<Compile Include="MSTest\RegularTestFixture.cs" />
71+
<Compile Include="MSTest\TestFixtureWithTraits.cs" />
7172
<Compile Include="NUnit\TestFixtureWithNestedTestClasses.cs" />
7273
<Compile Include="NUnit\TestFixtureWithoutExplicitTextFixtureAttribute.cs" />
7374
<Compile Include="NUnit\RegularTestFixture.cs" />
@@ -86,13 +87,6 @@
8687
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
8788
</ItemGroup>
8889
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
89-
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
90-
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
91-
<PropertyGroup>
92-
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
93-
</PropertyGroup>
94-
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
95-
</Target>
9690
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
9791
Other similar extension points exist, see Microsoft.Common.targets.
9892
<Target Name="BeforeBuild">

OpenCover.UI.TestDiscoverer.Tests/DiscovererTestsBase.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ namespace OpenCover.UI.TestDiscoverer.Tests
1010
[TestFixture]
1111
abstract class DiscovererTestsBase
1212
{
13-
protected void AssertDiscoveredMethod(Type testFixtureInAssemblyToDiscoverTestsIn, string expectedNameOfFirstTestMethod, TestType frameworkType)
13+
protected void AssertDiscoveredMethod(Type testFixtureInAssemblyToDiscoverTestsIn,
14+
string expectedNameOfFirstTestMethod, TestType frameworkType, string[] expectedTraits = null)
1415
{
1516
// Arrange
1617
var discoverer = new Discoverer(new List<string> { testFixtureInAssemblyToDiscoverTestsIn.Assembly.Location });
@@ -30,6 +31,12 @@ protected void AssertDiscoveredMethod(Type testFixtureInAssemblyToDiscoverTestsI
3031
var discoveredMethod = discoveredTestClass.TestMethods
3132
.FirstOrDefault(x => x.Name == expectedNameOfFirstTestMethod);
3233
discoveredMethod.Should().NotBeNull();
34+
35+
if (expectedTraits != null)
36+
{
37+
discoveredMethod.Traits.ShouldAllBeEquivalentTo(expectedTraits);
38+
}
3339
}
40+
3441
}
3542
}

OpenCover.UI.TestDiscoverer.Tests/MSTest/MSTestDiscovererTests.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,25 @@ public void Discover_Finds_Sub_Test_Fixtures_And_Methods(Type testFixtureInAssem
2121
AssertDiscoveredMethod(testFixtureInAssemblyToDiscoverTestsIn, expectedNameOfFirstTestMethod, TestType.MSTest);
2222
}
2323

24+
[Ignore("MsTest Discoverer doesn't find base class methods yet"),
25+
TestCase(typeof(TestFixtureInheritingTraitMethods),
26+
"TestMethod_TestFixtureWithTraits",
27+
new[] { "Category_TestMethod_TestFixtureWithTraits" })]
28+
public void Discover_Finds_Inherited_Fixtures_And_Methods_With_Traits(Type testFixtureInAssemblyToDiscoverTestsIn, string expectedNameOfFirstTestMethod, string[] expectedTraits)
29+
{
30+
AssertDiscoveredMethod(testFixtureInAssemblyToDiscoverTestsIn, expectedNameOfFirstTestMethod, TestType.MSTest, expectedTraits);
31+
}
32+
33+
[TestCase(typeof(TestFixtureWithTraits),
34+
"TestMethod_TestFixtureWithTraits",
35+
new[] { "Category_TestMethod_TestFixtureWithTraits" })]
36+
[TestCase(typeof(TestFixtureInheritingTraitMethods),
37+
"TestMethod_TestFixtureInheritingTraitMethods",
38+
new[] { "Category_TestMethod_TestFixtureInheritingTraitMethods_1",
39+
"Category_TestMethod_TestFixtureInheritingTraitMethods_2" })]
40+
public void Discover_Finds_Fixtures_And_Methods_With_Traits(Type testFixtureInAssemblyToDiscoverTestsIn, string expectedNameOfFirstTestMethod, string[] expectedTraits)
41+
{
42+
AssertDiscoveredMethod(testFixtureInAssemblyToDiscoverTestsIn, expectedNameOfFirstTestMethod, TestType.MSTest, expectedTraits);
43+
}
2444
}
2545
}

OpenCover.UI.TestDiscoverer.Tests/OpenCover.UI.TestDiscoverer.Tests.csproj

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,6 @@
8888
</ItemGroup>
8989
<ItemGroup />
9090
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
91-
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
92-
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
93-
<PropertyGroup>
94-
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
95-
</PropertyGroup>
96-
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
97-
</Target>
9891
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
9992
Other similar extension points exist, see Microsoft.Common.targets.
10093
<Target Name="BeforeBuild">

OpenCover.UI.TestDiscoverer/OpenCover.UI.TestDiscoverer.csproj

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,6 @@
8282
</ItemGroup>
8383
<ItemGroup />
8484
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
85-
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
86-
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
87-
<PropertyGroup>
88-
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
89-
</PropertyGroup>
90-
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
91-
</Target>
9285
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
9386
Other similar extension points exist, see Microsoft.Common.targets.
9487
<Target Name="BeforeBuild">

0 commit comments

Comments
 (0)