diff --git a/build/pack.cake b/build/pack.cake index 808f8af7aa..2cfd1b48f0 100644 --- a/build/pack.cake +++ b/build/pack.cake @@ -63,11 +63,18 @@ Task("Test") CoverletOutputName = $"{projectName}.coverage.xml" }; + var filters = new List(); + if (IsRunningOnUnix()) { - settings.Filter = "TestCategory!=NoMono"; + filters.Add("TestCategory!=NoUnix"); + if (string.Equals(framework, parameters.FullFxVersion)) + filters.Add("TestCategory!=NoMono"); } + if (filters.Any()) + settings.Filter = string.Join(" & ", filters); + DotNetCoreTest(project.FullPath, settings, coverletSettings); }); } diff --git a/src/GitVersionCore.Tests/AssemblyInfoFileUpdaterTests.cs b/src/GitVersionCore.Tests/AssemblyInfoFileUpdaterTests.cs index 4dddbeba5e..fc27ca11d9 100644 --- a/src/GitVersionCore.Tests/AssemblyInfoFileUpdaterTests.cs +++ b/src/GitVersionCore.Tests/AssemblyInfoFileUpdaterTests.cs @@ -434,7 +434,7 @@ public void ShouldAddAssemblyInformationalVersionWhenUpdatingAssemblyVersionFile [TestCase("cs", "[assembly: AssemblyVersion(\"1.0.0.0\")]\r\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\r\n// comment\r\n")] [TestCase("fs", "[]\r\n[]\r\ndo\r\n()\r\n")] [TestCase("vb", "\r\n\r\n' comment\r\n")] - [Category("NoMono")] + [Category("NoUnix")] [Description("Won't run on Mono due to source information not being available for ShouldMatchApproved.")] public void Issue1183_ShouldAddFSharpAssemblyInformationalVersionBesideOtherAttributes(string fileExtension, string assemblyFileContent) { diff --git a/src/GitVersionCore.Tests/ConfigProviderTests.cs b/src/GitVersionCore.Tests/ConfigProviderTests.cs index ab8cd15209..849e95841a 100644 --- a/src/GitVersionCore.Tests/ConfigProviderTests.cs +++ b/src/GitVersionCore.Tests/ConfigProviderTests.cs @@ -278,7 +278,7 @@ public void NoWarnOnGitVersionYmlFile() { ConfigurationProvider.Provide(repoPath, fileSystem, configFileLocator); } - s.Length.ShouldBe(0); + s.ShouldBeEmpty(); } string SetupConfigFileContent(string text, string fileName = DefaultConfigFileLocator.DefaultFileName) diff --git a/src/GitVersionCore.Tests/DefaultConfigFileLocatorTests.cs b/src/GitVersionCore.Tests/DefaultConfigFileLocatorTests.cs index 8cd710ce35..cc32a3b9a5 100644 --- a/src/GitVersionCore.Tests/DefaultConfigFileLocatorTests.cs +++ b/src/GitVersionCore.Tests/DefaultConfigFileLocatorTests.cs @@ -88,7 +88,7 @@ public void NoWarnOnGitVersionYmlFile() { ConfigurationProvider.Provide(repoPath, fileSystem, configFileLocator); } - s.Length.ShouldBe(0); + s.ShouldBeEmpty(); } string SetupConfigFileContent(string text, string fileName = DefaultConfigFileLocator.DefaultFileName) diff --git a/src/GitVersionCore.Tests/Init/InitScenarios.cs b/src/GitVersionCore.Tests/Init/InitScenarios.cs index c79adfa127..0f60037d34 100644 --- a/src/GitVersionCore.Tests/Init/InitScenarios.cs +++ b/src/GitVersionCore.Tests/Init/InitScenarios.cs @@ -14,7 +14,7 @@ public void Setup() } [Test] - [Category("NoMono")] + [Category("NoUnix")] [Description("Won't run on Mono due to source information not being available for ShouldMatchApproved.")] public void CanSetNextVersion() { diff --git a/src/GitVersionCore.Tests/LoggerTest.cs b/src/GitVersionCore.Tests/LoggerTest.cs index 09f097eb5e..d505158ffd 100644 --- a/src/GitVersionCore.Tests/LoggerTest.cs +++ b/src/GitVersionCore.Tests/LoggerTest.cs @@ -1,4 +1,4 @@ -using NUnit.Framework; +using NUnit.Framework; using System; using GitVersion; using Shouldly; @@ -20,7 +20,7 @@ public void LoggerObscuresPassword(string protocol) using (Logger.AddLoggersTemporarily(action, action, action, action)) Logger.WriteInfo($"{protocol}://{username}:{password}@workspace.visualstudio.com/DefaultCollection/_git/CAS"); - s.Contains(password).ShouldBe(false); + s.ShouldNotContain(password); } [Test] @@ -32,7 +32,7 @@ public void UsernameWithoutPassword() using (Logger.AddLoggersTemporarily(action, action, action, action)) Logger.WriteInfo(repoUrl); - s.Contains(repoUrl).ShouldBe(true); + s.ShouldContain(repoUrl); } } } diff --git a/src/GitVersionCore.Tests/NamedConfigFileLocatorTests.cs b/src/GitVersionCore.Tests/NamedConfigFileLocatorTests.cs index 0232f3befe..e07733f6bb 100644 --- a/src/GitVersionCore.Tests/NamedConfigFileLocatorTests.cs +++ b/src/GitVersionCore.Tests/NamedConfigFileLocatorTests.cs @@ -51,7 +51,7 @@ public void NoWarnOnCustomYmlFile() { ConfigurationProvider.Provide(repoPath, fileSystem, configFileLocator); } - s.Length.ShouldBe(0); + s.ShouldBeEmpty(); } [Test] @@ -65,7 +65,7 @@ public void NoWarnOnCustomYmlFileOutsideRepoPath() { ConfigurationProvider.Provide(repoPath, fileSystem, configFileLocator); } - s.Length.ShouldBe(0); + s.ShouldBeEmpty(); } string SetupConfigFileContent(string text, string fileName = null, string path = null) diff --git a/src/GitVersionExe.Tests/ExecCmdLineArgumentTest.cs b/src/GitVersionExe.Tests/ExecCmdLineArgumentTest.cs index eae65f4b59..c472d53fba 100644 --- a/src/GitVersionExe.Tests/ExecCmdLineArgumentTest.cs +++ b/src/GitVersionExe.Tests/ExecCmdLineArgumentTest.cs @@ -89,7 +89,7 @@ public void WorkingDirectoryWithoutGitFolderCrashesWithInformativeMessage() } [Test] - [Category("NoMono")] + [Category("NoUnix")] [Description("Doesn't work on Mono/Unix because of the path heuristics that needs to be done there in order to figure out whether the first argument actually is a path.")] public void WorkingDirectoryDoesNotExistCrashesWithInformativeMessage() { diff --git a/src/GitVersionExe.Tests/UpdateWixVersionFileTests.cs b/src/GitVersionExe.Tests/UpdateWixVersionFileTests.cs index 73e43ca38c..38a0d95e31 100644 --- a/src/GitVersionExe.Tests/UpdateWixVersionFileTests.cs +++ b/src/GitVersionExe.Tests/UpdateWixVersionFileTests.cs @@ -22,7 +22,7 @@ public void Setup() } [Test] - [Category("NoMono")] + [Category("NoUnix")] [Description("Doesn't work on Mono/Unix because of the path heuristics that needs to be done there in order to figure out whether the first argument actually is a path.")] public void WixVersionFileCreationTest() { @@ -37,7 +37,7 @@ public void WixVersionFileCreationTest() } [Test] - [Category("NoMono")] + [Category("NoUnix")] [Description("Doesn't work on Mono/Unix because of the path heuristics that needs to be done there in order to figure out whether the first argument actually is a path.")] public void WixVersionFileVarCountTest() { @@ -60,7 +60,7 @@ public void WixVersionFileVarCountTest() } [Test] - [Category("NoMono")] + [Category("NoUnix")] [Description("Doesn't work on Mono/Unix because of the path heuristics that needs to be done there in order to figure out whether the first argument actually is a path.")] public void WixVersionFileContentTest() {