diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 30b4c83..c88ffa1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,7 @@ version: 2 updates: - package-ecosystem: "nuget" - directory: "/src/" + directory: "/" schedule: interval: "monthly" labels: diff --git a/Directory.Packages.props b/Directory.Packages.props index d25bb69..a96a3f1 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -6,16 +6,16 @@ - - + + - - - - + + + + @@ -23,17 +23,17 @@ - + - - + + - + - + diff --git a/src/UnitTests/TaskTestBase.cs b/src/UnitTests/TaskTestBase.cs index a78d19e..10995e4 100644 --- a/src/UnitTests/TaskTestBase.cs +++ b/src/UnitTests/TaskTestBase.cs @@ -351,7 +351,7 @@ public void ShouldCorrectlyParseBooleanValues() JObject parameters = (JObject)armTemplate["parameters"]; Assert.AreEqual("array", parameters.GetValue("options", comparison)["type"].ToString()); Assert.AreEqual("Boolean", parameters.GetValue("options", comparison)["value"].First()["isEnabled"].Type.ToString()); - Assert.AreEqual(true, parameters.GetValue("options", comparison)["value"].First()["isEnabled"].Value()); + Assert.IsTrue(parameters.GetValue("options", comparison)["value"].First()["isEnabled"].Value()); } [TestMethod] @@ -401,7 +401,7 @@ public void ShouldIncludeAdditionalPropertiesInJsonInput(bool useLegacyAdditiona Assert.AreEqual("String", parameters.GetValue("options", comparison)["value"].First()["source"].Type.ToString()); Assert.AreEqual("file1", parameters.GetValue("options", comparison)["value"].First()["source"].Value()); Assert.AreEqual("Boolean", parameters.GetValue("options", comparison)["value"].First()["isEnabled"].Type.ToString()); - Assert.AreEqual(true, parameters.GetValue("options", comparison)["value"].First()["isEnabled"].Value()); + Assert.IsTrue(parameters.GetValue("options", comparison)["value"].First()["isEnabled"].Value()); } [TestMethod] @@ -456,7 +456,7 @@ public void ShouldIncludeAdditionalPropertiesInArmParameterFile(bool useLegacyAd Assert.AreEqual("String", parameters.GetValue("options", comparison)["value"].First()["source"].Type.ToString()); Assert.AreEqual("file1.parameters", parameters.GetValue("options", comparison)["value"].First()["source"].Value()); Assert.AreEqual("Boolean", parameters.GetValue("options", comparison)["value"].First()["isEnabled"].Type.ToString()); - Assert.AreEqual(true, parameters.GetValue("options", comparison)["value"].First()["isEnabled"].Value()); + Assert.IsTrue(parameters.GetValue("options", comparison)["value"].First()["isEnabled"].Value()); } [TestMethod] @@ -521,7 +521,8 @@ public void StressTest_ShouldAddSourcePropertyManyFiles() [Description("Test that files are correctly translated between ARM, JSON, and YAML.")] public void ShouldTranslateBetweenFormatsAndValidateNoDataLoss(string inputType, string[] steps) { - Assert.IsTrue(steps?.Length > 0); + Assert.IsNotNull(steps); + Assert.IsGreaterThan(steps.Length, 0); // Setup input file string inputFilePath = SetupInputFile(inputType); diff --git a/src/UnitTests/TaskUnixTests.cs b/src/UnitTests/TaskUnixTests.cs index f1e44a2..4d60ed9 100644 --- a/src/UnitTests/TaskUnixTests.cs +++ b/src/UnitTests/TaskUnixTests.cs @@ -3,10 +3,14 @@ namespace AggregateConfigBuildTask.Tests.Unit [TestClass] public class TaskUnixTests : TaskTestBase { - [TestInitialize] - public void TestInitialize() - { - base.TestInitialize(isWindowsMode: false, testPath: "//mnt/drive/MockDirectory"); - } - } -} + [TestInitialize] + public void TestInitialize() + { + if (TestContext is not null) + { + TestContext.CooperativeCancellation = true; + } + base.TestInitialize(isWindowsMode: false, testPath: "//mnt/drive/MockDirectory"); + } + } +} diff --git a/src/UnitTests/TaskWindowsTests.cs b/src/UnitTests/TaskWindowsTests.cs index a67168e..a311760 100644 --- a/src/UnitTests/TaskWindowsTests.cs +++ b/src/UnitTests/TaskWindowsTests.cs @@ -3,10 +3,14 @@ namespace AggregateConfigBuildTask.Tests.Unit [TestClass] public class TaskWindowsTests : TaskTestBase { - [TestInitialize] - public void TestInitialize() - { - base.TestInitialize(isWindowsMode: true, testPath: "C:\\MockDirectory"); - } - } -} + [TestInitialize] + public void TestInitialize() + { + if (TestContext is not null) + { + TestContext.CooperativeCancellation = true; + } + base.TestInitialize(isWindowsMode: true, testPath: "C:\\MockDirectory"); + } + } +} diff --git a/test/IntegrationTests/IntegrationTests.csproj b/test/IntegrationTests/IntegrationTests.csproj index 1bbeaf3..53b25ed 100644 --- a/test/IntegrationTests/IntegrationTests.csproj +++ b/test/IntegrationTests/IntegrationTests.csproj @@ -8,7 +8,7 @@ false true true - 0.0.1 + 0.0.1