Skip to content

Commit feff474

Browse files
committed
[UnitTesting] Disable tests if .NET Core not installed
Downgrade the .NET Core project to version 1.1 to avoid the pop-up dialog asking to install .NET Core 2.0. Fix test names not matching the projects being tested.
1 parent 399c910 commit feff474

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/BasicTests.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
using System.Linq;
2424
using MonoDevelop.Ide;
2525
using MonoDevelop.Core;
26+
using MonoDevelop.DotNetCore;
2627
using System.Diagnostics;
2728
using System.Threading;
2829

@@ -42,13 +43,17 @@ public void Start()
4243
[Test()]
4344
public async Task TestsXUnitDotNetFull()
4445
{
45-
await CommonTestDiscovery("unit-testing-xunit-dotnetcore");
46+
await CommonTestDiscovery("unit-testing-xunit-dotnetfull");
4647
}
4748

4849
[Test()]
4950
public async Task TestsXUnitDotNetCore()
5051
{
51-
await CommonTestDiscovery("unit-testing-xunit-dotnetfull");
52+
if (!DotNetCoreRuntime.IsInstalled) {
53+
Assert.Ignore (".NET Core needs to be installed.");
54+
}
55+
56+
await CommonTestDiscovery("unit-testing-xunit-dotnetcore");
5257
}
5358

5459
async Task CommonTestDiscovery(string projectName)

main/src/addins/MonoDevelop.UnitTesting/MonoDevelop.UnitTesting.Tests/MonoDevelop.UnitTesting.Tests.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@
8383
<Project>{A7A4246D-CEC4-42DF-A3C1-C31B9F51C4EC}</Project>
8484
<Name>MonoDevelop.UnitTesting</Name>
8585
</ProjectReference>
86+
<ProjectReference Include="..\..\MonoDevelop.DotNetCore\MonoDevelop.DotNetCore.csproj">
87+
<Project>{6868153E-41EA-43A4-A81A-C1E7256373F7}</Project>
88+
<Name>MonoDevelop.DotNetCore</Name>
89+
<Private>False</Private>
90+
</ProjectReference>
8691
</ItemGroup>
8792
<ItemGroup>
8893
<None Include="packages.config" />

main/tests/test-projects/unit-testing-addin/unit-testing-xunit-dotnetcore/unit-testing-xunit-dotnetcore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.0</TargetFramework>
4+
<TargetFramework>netcoreapp1.1</TargetFramework>
55

66
<IsPackable>false</IsPackable>
77
</PropertyGroup>

0 commit comments

Comments
 (0)