From b8659059ca1913557bed0a3b32b644345d7af5dd Mon Sep 17 00:00:00 2001 From: Dara Keon Date: Sun, 26 Nov 2023 20:54:05 +0000 Subject: [PATCH] tools: update to .NET 8.0 --- Source/Eml.Tests/Base64Step.cs | 2 +- Source/Eml.Tests/Eml.Tests.csproj | 4 +-- Source/Eml.Tests/EmlReaderStep.cs | 35 ++++++++++++----------- Source/Eml/Eml.csproj | 8 +++--- Source/MVC/MVC.csproj | 10 +++---- Source/NHibernate/NHibernate.csproj | 6 ++-- Source/TwoFactorAuth/TwoFactorAuth.csproj | 8 +++--- Source/Util.Tests/Util.Tests.csproj | 9 ++++-- Source/Util/Util.csproj | 6 ++-- Source/XML/XML.csproj | 6 ++-- 10 files changed, 49 insertions(+), 45 deletions(-) diff --git a/Source/Eml.Tests/Base64Step.cs b/Source/Eml.Tests/Base64Step.cs index a070a7a..d7eba2c 100644 --- a/Source/Eml.Tests/Base64Step.cs +++ b/Source/Eml.Tests/Base64Step.cs @@ -39,7 +39,7 @@ public void WhenAskToDecodeIt() [Then(@"the new text will be (.+)")] public void ThenTheNewTextWillBeTitle(String expected) { - Assert.AreEqual(expected, decoded); + Assert.That(decoded, Is.EqualTo(expected)); } } } diff --git a/Source/Eml.Tests/Eml.Tests.csproj b/Source/Eml.Tests/Eml.Tests.csproj index 1c4ad4f..977993c 100644 --- a/Source/Eml.Tests/Eml.Tests.csproj +++ b/Source/Eml.Tests/Eml.Tests.csproj @@ -1,13 +1,13 @@ - net7.0 + net8.0 false - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Source/Eml.Tests/EmlReaderStep.cs b/Source/Eml.Tests/EmlReaderStep.cs index 942da57..a13be8d 100644 --- a/Source/Eml.Tests/EmlReaderStep.cs +++ b/Source/Eml.Tests/EmlReaderStep.cs @@ -98,13 +98,13 @@ public void WhenContentReadIsCalled() [Then(@"the result is null")] public void ThenTheResultIsNull() { - Assert.IsNull(reader); + Assert.That(reader, Is.Null); } [Then(@"the result is not null")] public void ThenTheResultIsNotNull() { - Assert.IsNotNull(reader); + Assert.That(reader, Is.Not.Null); } [Then(@"the body is")] @@ -117,11 +117,11 @@ public void ThenTheBodyIs(Table table) var actual = reader.Body.Split("\n"); - Assert.AreEqual(expected.Length, actual.Length); + Assert.That(actual.Length, Is.EqualTo(expected.Length)); for (var l = 0; l < actual.Length; l++) { - Assert.AreEqual(expected[l], actual[l]); + Assert.That(actual[l], Is.EqualTo(expected[l])); } } @@ -135,16 +135,16 @@ public void ThenTheBodyIsSameAsContentOf(String filename) for (var l = 0; l < Math.Min(actual.Length, expected.Length); l++) { - Assert.AreEqual(expected[l], actual[l], $"Line {l}"); + Assert.That(actual[l], Is.EqualTo(expected[l]), $"Line {l}"); } - Assert.AreEqual(expected.Length, actual.Length); + Assert.That(actual.Length, Is.EqualTo(expected.Length)); } [Then(@"the creation date is (\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}|null)")] public void ThenTheCreationDateIs(DateTime? creation) { - Assert.AreEqual(creation, reader.Creation); + Assert.That(reader.Creation, Is.EqualTo(creation)); } [Then(@"the header is")] @@ -156,31 +156,32 @@ public void ThenTheHeaderIs(Table table) foreach (var key in headers.Keys) { - Assert.True( + Assert.That( reader.Headers.ContainsKey(key), + Is.True, $"Key '{key}' not found" ); var expected = headers[key] .Replace("§", "\t"); - Assert.AreEqual( - trimAmpersand(expected), + Assert.That( reader.Headers[key], + Is.EqualTo(trimAmpersand(expected)), $"Key '{key}' with wrong value" ); } - Assert.AreEqual(headers.Count, reader.Headers.Count); + Assert.That(reader.Headers.Count, Is.EqualTo(headers.Count)); } [Then(@"the subject is (.+)")] public void ThenTheSubjectIs(String subject) { if (subject == "null") - Assert.Null(reader.Subject); + Assert.That(reader.Subject, Is.Null); else - Assert.AreEqual(subject, reader.Subject); + Assert.That(reader.Subject, Is.EqualTo(subject)); } [Then(@"these contents will be the attachments")] @@ -193,16 +194,16 @@ public void ThenTheseContentsWillBeTheAttachments(Table table) var actual = reader.Attachments; - Assert.AreEqual(fileNames.Length, actual.Count); + Assert.That(actual.Count, Is.EqualTo(fileNames.Length)); for (var l = 0; l < actual.Count; l++) { var fileName = fileNames[l]; var path = Path.Combine("examples", fileName); - Assert.AreEqual( - File.ReadAllText(path), - actual[l] + Assert.That( + actual[l], + Is.EqualTo(File.ReadAllText(path)) ); } } diff --git a/Source/Eml/Eml.csproj b/Source/Eml/Eml.csproj index 3248cf6..17dbcba 100644 --- a/Source/Eml/Eml.csproj +++ b/Source/Eml/Eml.csproj @@ -1,7 +1,7 @@ - + - net7.0 + net8.0 Keon.Eml darakeon Dara Keon @@ -17,8 +17,8 @@ git eml reader Keon.Eml - 5.0.0 - Upgrade to .NET 7.0 + 6.0.0 + Upgrade to .NET 8.0 diff --git a/Source/MVC/MVC.csproj b/Source/MVC/MVC.csproj index 6f2129f..a72ac10 100644 --- a/Source/MVC/MVC.csproj +++ b/Source/MVC/MVC.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 Keon.MVC Keon.MVC darakeon @@ -14,10 +14,10 @@ https://github.com/darakeon/dk-lib git utility mvc - Upgrade to .NET 7.0 + Upgrade to .NET 8.0 true true - 4.0.2 + 5.0.0 image.png @@ -26,9 +26,9 @@ - + - + diff --git a/Source/NHibernate/NHibernate.csproj b/Source/NHibernate/NHibernate.csproj index 25e2da3..a2c15d0 100644 --- a/Source/NHibernate/NHibernate.csproj +++ b/Source/NHibernate/NHibernate.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 Keon.NHibernate Keon.NHibernate darakeon @@ -14,10 +14,10 @@ https://github.com/darakeon/dk-lib git utility nhibernate orm - Upgrade to .NET 7.0 + Upgrade to .NET 8.0 true true - 4.0.4 + 5.0.0 image.png diff --git a/Source/TwoFactorAuth/TwoFactorAuth.csproj b/Source/TwoFactorAuth/TwoFactorAuth.csproj index 1a60da7..af68ce7 100644 --- a/Source/TwoFactorAuth/TwoFactorAuth.csproj +++ b/Source/TwoFactorAuth/TwoFactorAuth.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 Keon.TwoFactorAuth Keon.TwoFactorAuth darakeon @@ -14,10 +14,10 @@ https://github.com/darakeon/dk-lib git utility two-factor twofactor 2fa tfa - Upgrade to .NET 7.0 + Upgrade to .NET 8.0 true true - 3.0.1 + 4.0.0 image.png @@ -26,7 +26,7 @@ - + diff --git a/Source/Util.Tests/Util.Tests.csproj b/Source/Util.Tests/Util.Tests.csproj index 9cb70a5..1aa6651 100644 --- a/Source/Util.Tests/Util.Tests.csproj +++ b/Source/Util.Tests/Util.Tests.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 Keon.Util.Tests Keon.Util.Tests enable @@ -13,9 +13,12 @@ - + - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + diff --git a/Source/Util/Util.csproj b/Source/Util/Util.csproj index 84b84ba..473d564 100644 --- a/Source/Util/Util.csproj +++ b/Source/Util/Util.csproj @@ -1,7 +1,7 @@ - net7.0 + net8.0 Keon.Util Keon.Util darakeon @@ -14,10 +14,10 @@ https://github.com/darakeon/dk-lib git utility - Upgrade to .NET 7.0 + Upgrade to .NET 8.0 true true - 4.1.0 + 5.0.0 image.png diff --git a/Source/XML/XML.csproj b/Source/XML/XML.csproj index 146cbb0..99a0cbd 100644 --- a/Source/XML/XML.csproj +++ b/Source/XML/XML.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 Keon.XML Keon.XML darakeon @@ -14,10 +14,10 @@ https://github.com/darakeon/dk-lib git utility xml - Upgrade to .NET 7.0 + Upgrade to .NET 8.0 true true - 4.0.0 + 5.0.0 image.png