diff options
Diffstat (limited to 'src/SMAPI.Tests/Utilities')
-rw-r--r-- | src/SMAPI.Tests/Utilities/SDateTests.cs | 4 | ||||
-rw-r--r-- | src/SMAPI.Tests/Utilities/SemanticVersionTests.cs | 23 |
2 files changed, 14 insertions, 13 deletions
diff --git a/src/SMAPI.Tests/Utilities/SDateTests.cs b/src/SMAPI.Tests/Utilities/SDateTests.cs index 1f31168e..d25a101a 100644 --- a/src/SMAPI.Tests/Utilities/SDateTests.cs +++ b/src/SMAPI.Tests/Utilities/SDateTests.cs @@ -6,7 +6,7 @@ using System.Text.RegularExpressions; using NUnit.Framework; using StardewModdingAPI.Utilities; -namespace StardewModdingAPI.Tests.Utilities +namespace SMAPI.Tests.Utilities { /// <summary>Unit tests for <see cref="SDate"/>.</summary> [TestFixture] @@ -159,7 +159,7 @@ namespace StardewModdingAPI.Tests.Utilities [TestCase("15 summer Y1", -28, ExpectedResult = "15 spring Y1")] // negative season transition [TestCase("15 summer Y2", -28 * 4, ExpectedResult = "15 summer Y1")] // negative year transition [TestCase("01 spring Y3", -(28 * 7 + 17), ExpectedResult = "12 spring Y1")] // negative year transition - [TestCase("06 fall Y2", 50, ExpectedResult = "28 winter Y3")] // test for zero-index errors + [TestCase("06 fall Y2", 50, ExpectedResult = "28 winter Y2")] // test for zero-index errors [TestCase("06 fall Y2", 51, ExpectedResult = "01 spring Y3")] // test for zero-index errors public string AddDays(string dateStr, int addDays) { diff --git a/src/SMAPI.Tests/Utilities/SemanticVersionTests.cs b/src/SMAPI.Tests/Utilities/SemanticVersionTests.cs index 2e7719eb..c91ec27f 100644 --- a/src/SMAPI.Tests/Utilities/SemanticVersionTests.cs +++ b/src/SMAPI.Tests/Utilities/SemanticVersionTests.cs @@ -2,9 +2,10 @@ using System; using System.Diagnostics.CodeAnalysis; using Newtonsoft.Json; using NUnit.Framework; +using StardewModdingAPI; using StardewModdingAPI.Framework; -namespace StardewModdingAPI.Tests.Utilities +namespace SMAPI.Tests.Utilities { /// <summary>Unit tests for <see cref="SemanticVersion"/>.</summary> [TestFixture] @@ -17,10 +18,10 @@ namespace StardewModdingAPI.Tests.Utilities ** Constructor ****/ [Test(Description = "Assert that the constructor sets the expected values for all valid versions when constructed from a string.")] - [TestCase("1.0", ExpectedResult = "1.0")] - [TestCase("1.0.0", ExpectedResult = "1.0")] + [TestCase("1.0", ExpectedResult = "1.0.0")] + [TestCase("1.0.0", ExpectedResult = "1.0.0")] [TestCase("3000.4000.5000", ExpectedResult = "3000.4000.5000")] - [TestCase("1.2-some-tag.4", ExpectedResult = "1.2-some-tag.4")] + [TestCase("1.2-some-tag.4", ExpectedResult = "1.2.0-some-tag.4")] [TestCase("1.2.3-some-tag.4", ExpectedResult = "1.2.3-some-tag.4")] [TestCase("1.2.3-SoME-tAg.4", ExpectedResult = "1.2.3-SoME-tAg.4")] [TestCase("1.2.3-some-tag.4 ", ExpectedResult = "1.2.3-some-tag.4")] @@ -30,7 +31,7 @@ namespace StardewModdingAPI.Tests.Utilities } [Test(Description = "Assert that the constructor sets the expected values for all valid versions when constructed from the individual numbers.")] - [TestCase(1, 0, 0, null, ExpectedResult = "1.0")] + [TestCase(1, 0, 0, null, ExpectedResult = "1.0.0")] [TestCase(3000, 4000, 5000, null, ExpectedResult = "3000.4000.5000")] [TestCase(1, 2, 3, "", ExpectedResult = "1.2.3")] [TestCase(1, 2, 3, " ", ExpectedResult = "1.2.3")] @@ -65,7 +66,7 @@ namespace StardewModdingAPI.Tests.Utilities } [Test(Description = "Assert that the constructor sets the expected values for all valid versions when constructed from an assembly version.")] - [TestCase(1, 0, 0, ExpectedResult = "1.0")] + [TestCase(1, 0, 0, ExpectedResult = "1.0.0")] [TestCase(1, 2, 3, ExpectedResult = "1.2.3")] [TestCase(3000, 4000, 5000, ExpectedResult = "3000.4000.5000")] public string Constructor_FromAssemblyVersion(int major, int minor, int patch) @@ -243,19 +244,19 @@ namespace StardewModdingAPI.Tests.Utilities } /**** - ** Serialisable + ** Serializable ****/ [Test(Description = "Assert that SemanticVersion can be round-tripped through JSON with no special configuration.")] - [TestCase("1.0")] - public void Serialisable(string versionStr) + [TestCase("1.0.0")] + public void Serializable(string versionStr) { // act string json = JsonConvert.SerializeObject(new SemanticVersion(versionStr)); SemanticVersion after = JsonConvert.DeserializeObject<SemanticVersion>(json); // assert - Assert.IsNotNull(after, "The semantic version after deserialisation is unexpectedly null."); - Assert.AreEqual(versionStr, after.ToString(), "The semantic version after deserialisation doesn't match the input version."); + Assert.IsNotNull(after, "The semantic version after deserialization is unexpectedly null."); + Assert.AreEqual(versionStr, after.ToString(), "The semantic version after deserialization doesn't match the input version."); } /**** |