From ed2de92ab7e688905091e50970f377b3cab7da25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20L=2E=20Charlier?= Date: Tue, 28 Nov 2023 08:24:26 +0100 Subject: [PATCH] chore: bump NUnit from 3.14.0 to 4.0.0 (#709) --- .../DubUrl.Adomd.Testing.csproj | 2 +- .../Mapping/NativeMapperIntrospectorTest.cs | 18 +++++--- .../DubUrl.Extensions.Testing.csproj | 2 +- .../DubUrl.OleDb.Testing.csproj | 2 +- .../Rewriting/OleDbRewriterTest.cs | 7 ++- .../WrapperMapperIntrospectorTest.cs | 16 +++++-- DubUrl.QA/BaseAdomdProvider.cs | 37 +++++++++------ DubUrl.QA/DubUrl.QA.csproj | 2 +- DubUrl.Testing/DubUrl.Testing.csproj | 2 +- .../OdbcDriver/DriverLocatorFactoryTest.cs | 16 +++++-- .../DriverLocatorIntrospectorTest.cs | 9 ++-- .../Locating/RegexUtils/AnyOfCapture.cs | 7 ++- .../Locating/RegexUtils/CompositeRegex.cs | 9 ++-- .../Locating/RegexUtils/OptionalCapture.cs | 7 ++- .../Locating/RegexUtils/VersionCapture.cs | 7 ++- .../Implementation/PostgresqlMapperTest.cs | 2 +- .../Implementation/QuestDbMapperTest.cs | 2 +- .../Mapping/NativeMapperIntrospectorTest.cs | 46 +++++++++++++------ .../Mapping/SchemeMapperBuilderTest.cs | 9 ++-- .../Mapping/WrapperMapperIntrospectorTest.cs | 25 ++++++---- .../MicroOrm/ReflectionCacheTest.cs | 28 +++++++---- DubUrl.Testing/Parsing/ParserTest.cs | 44 ++++++++++++------ .../Querying/Dialects/DialectBuilderTest.cs | 7 ++- .../Registering/BinFolderDiscovererTest.cs | 7 ++- .../ProviderFactoriesRegistratorTest.cs | 7 ++- .../Implementation/CockRoachRewriterTest.cs | 14 ++++-- .../Implementation/Db2RewriterTest.cs | 7 ++- .../Implementation/DrillOdbcRewriterTest.cs | 30 ++++++++---- .../Implementation/FirebirdSqlRewriterTest.cs | 14 ++++-- .../MySqlConnectorRewriterTest.cs | 21 ++++++--- .../Implementation/MySqlDataRewriterTest.cs | 21 ++++++--- .../Implementation/OdbcDbqRewriterTest.cs | 14 ++++-- .../Implementation/OdbcRewriterTest.cs | 14 ++++-- .../OracleManagedDataAccessRewriterTest.cs | 34 +++++++++----- .../Implementation/PostgresqlRewriterTest.cs | 14 ++++-- .../Implementation/QuestDbRewriterTest.cs | 7 ++- .../Implementation/SnowflakeRewriterTest.cs | 14 ++++-- .../Implementation/TeradataRewriterTest.cs | 23 +++++++--- .../Implementation/TimescaleRewriterTest.cs | 14 ++++-- .../Implementation/TrinoOdbcRewriterTest.cs | 14 ++++-- 40 files changed, 396 insertions(+), 179 deletions(-) diff --git a/DubUrl.Adomd.Testing/DubUrl.Adomd.Testing.csproj b/DubUrl.Adomd.Testing/DubUrl.Adomd.Testing.csproj index 1d96f86f..475aeecc 100644 --- a/DubUrl.Adomd.Testing/DubUrl.Adomd.Testing.csproj +++ b/DubUrl.Adomd.Testing/DubUrl.Adomd.Testing.csproj @@ -2,7 +2,7 @@ - + diff --git a/DubUrl.Adomd.Testing/Mapping/NativeMapperIntrospectorTest.cs b/DubUrl.Adomd.Testing/Mapping/NativeMapperIntrospectorTest.cs index 09893133..c9300e18 100644 --- a/DubUrl.Adomd.Testing/Mapping/NativeMapperIntrospectorTest.cs +++ b/DubUrl.Adomd.Testing/Mapping/NativeMapperIntrospectorTest.cs @@ -30,8 +30,11 @@ public void Locate_OneMapperClass_ClassReturned() var result = introspector.Locate(); Assert.That(result, Is.Not.Null); - Assert.That(result.Count(), Is.EqualTo(1)); - Assert.That(result.ElementAt(0).MapperType, Is.EqualTo(typeof(PowerBiDesktopMapper))); + Assert.Multiple(() => + { + Assert.That(result.Count(), Is.EqualTo(1)); + Assert.That(result.ElementAt(0).MapperType, Is.EqualTo(typeof(PowerBiDesktopMapper))); + }); } [Test] @@ -42,10 +45,13 @@ public void Locate_OneMapperClassWithBrand_ClassReturned() var result = introspector.Locate(); Assert.That(result, Is.Not.Null); - Assert.That(result.Count(), Is.EqualTo(1)); - Assert.That(result.ElementAt(0).Slug, Is.EqualTo("powerbi")); - Assert.That(result.ElementAt(0).MainColor.Length, Is.EqualTo(7)); - Assert.That(result.ElementAt(0).SecondaryColor.Length, Is.EqualTo(7)); + Assert.Multiple(() => + { + Assert.That(result.Count(), Is.EqualTo(1)); + Assert.That(result.ElementAt(0).Slug, Is.EqualTo("powerbi")); + Assert.That(result.ElementAt(0).MainColor.Length, Is.EqualTo(7)); + Assert.That(result.ElementAt(0).SecondaryColor.Length, Is.EqualTo(7)); + }); } [Test] diff --git a/DubUrl.Extensions.Testing/DubUrl.Extensions.Testing.csproj b/DubUrl.Extensions.Testing/DubUrl.Extensions.Testing.csproj index a98cd8ec..f94d8743 100644 --- a/DubUrl.Extensions.Testing/DubUrl.Extensions.Testing.csproj +++ b/DubUrl.Extensions.Testing/DubUrl.Extensions.Testing.csproj @@ -10,7 +10,7 @@ - + diff --git a/DubUrl.OleDb.Testing/DubUrl.OleDb.Testing.csproj b/DubUrl.OleDb.Testing/DubUrl.OleDb.Testing.csproj index 9f1832f9..380522a5 100644 --- a/DubUrl.OleDb.Testing/DubUrl.OleDb.Testing.csproj +++ b/DubUrl.OleDb.Testing/DubUrl.OleDb.Testing.csproj @@ -2,7 +2,7 @@ - + diff --git a/DubUrl.OleDb.Testing/Rewriting/OleDbRewriterTest.cs b/DubUrl.OleDb.Testing/Rewriting/OleDbRewriterTest.cs index 23bc2b59..f023b6c5 100644 --- a/DubUrl.OleDb.Testing/Rewriting/OleDbRewriterTest.cs +++ b/DubUrl.OleDb.Testing/Rewriting/OleDbRewriterTest.cs @@ -108,8 +108,11 @@ public void Map_UrlInfoWithUsernamePassword_Authentication() Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey(OleDbRewriter.USERNAME_KEYWORD)); - Assert.That(result[OleDbRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); - Assert.That(result, Does.ContainKey(OleDbRewriter.PASSWORD_KEYWORD)); + Assert.Multiple(() => + { + Assert.That(result[OleDbRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); + Assert.That(result, Does.ContainKey(OleDbRewriter.PASSWORD_KEYWORD)); + }); Assert.That(result[OleDbRewriter.PASSWORD_KEYWORD], Is.EqualTo("pwd")); } diff --git a/DubUrl.OleDb.Testing/WrapperMapperIntrospectorTest.cs b/DubUrl.OleDb.Testing/WrapperMapperIntrospectorTest.cs index 834dbe8b..034abe20 100644 --- a/DubUrl.OleDb.Testing/WrapperMapperIntrospectorTest.cs +++ b/DubUrl.OleDb.Testing/WrapperMapperIntrospectorTest.cs @@ -40,9 +40,12 @@ public void LocateWrapper_TwoGenericMappersClassesForOneDatabase_WrapperReturned var result = introspector.Locate(); Assert.That(result, Is.Not.Null); - Assert.That(result.Count(), Is.EqualTo(2)); - Assert.That(result.ElementAt(0).MapperType, Is.EqualTo(typeof(OdbcMapper))); - Assert.That(result.ElementAt(1).MapperType, Is.EqualTo(typeof(OleDbMapper))); + Assert.Multiple(() => + { + Assert.That(result.Count(), Is.EqualTo(2)); + Assert.That(result.ElementAt(0).MapperType, Is.EqualTo(typeof(OdbcMapper))); + Assert.That(result.ElementAt(1).MapperType, Is.EqualTo(typeof(OleDbMapper))); + }); } [Test] @@ -57,8 +60,11 @@ public void LocateWrapper_TwoGenericMappersClassesForOneDatabaseButAlternative_W var result = introspector.Locate(); Assert.That(result, Is.Not.Null); - Assert.That(result.Count(), Is.EqualTo(1)); - Assert.That(result.ElementAt(0).MapperType, Is.EqualTo(typeof(OdbcMapper))); + Assert.Multiple(() => + { + Assert.That(result.Count(), Is.EqualTo(1)); + Assert.That(result.ElementAt(0).MapperType, Is.EqualTo(typeof(OdbcMapper))); + }); } } diff --git a/DubUrl.QA/BaseAdomdProvider.cs b/DubUrl.QA/BaseAdomdProvider.cs index 2a3aed37..3ae88c4f 100644 --- a/DubUrl.QA/BaseAdomdProvider.cs +++ b/DubUrl.QA/BaseAdomdProvider.cs @@ -20,7 +20,7 @@ namespace DubUrl.QA; public abstract class BaseAdomdProvider { protected SchemeMapperBuilder SchemeMapperBuilder { get; set; } - public virtual string SelectPrimitiveTemplate(string type) => "EVALUATE DATATABLE(\"value\", " + type + ", {{$value; format=\"value\"$}})"; + protected virtual string SelectPrimitiveTemplate(string type) => "EVALUATE DATATABLE(\"value\", " + type + ", {{$value; format=\"value\"$}})"; [OneTimeSetUp] public void SetupFixture() @@ -68,10 +68,13 @@ protected virtual void QueryCustomerScalarValueWithReader(string sql) using var cmd = conn.CreateCommand(); cmd.CommandText = sql; var reader = cmd.ExecuteReader(); - Assert.That(reader.Read(), Is.True); - Assert.That(reader.GetInt32(0), Is.EqualTo(1)); - Assert.That(reader.GetString(1), Is.EqualTo("Nikola Tesla")); - Assert.That(reader.GetDateTime(2), Is.EqualTo(new DateTime(1856, 10, 7))); + Assert.Multiple(() => + { + Assert.That(reader.Read(), Is.True); + Assert.That(reader.GetInt32(0), Is.EqualTo(1)); + Assert.That(reader.GetString(1), Is.EqualTo("Nikola Tesla")); + Assert.That(reader.GetDateTime(2), Is.EqualTo(new DateTime(1856, 10, 7))); + }); Assert.That(reader.Read(), Is.False); } @@ -316,10 +319,13 @@ protected void QueryCustomerWithDapper(string sql) using var conn = connectionUrl.Open(); var customers = conn.Query(sql).ToList(); Assert.That(customers, Has.Count.EqualTo(5)); - Assert.That(customers.Select(x => x.CustomerId).Distinct().ToList(), Has.Count.EqualTo(5)); - Assert.That(customers.Any(x => string.IsNullOrEmpty(x.FullName)), Is.False); - Assert.That(customers.Select(x => x.BirthDate).Distinct().ToList(), Has.Count.EqualTo(5)); - Assert.That(customers.Any(x => x.BirthDate == DateTime.MinValue), Is.False); + Assert.Multiple(() => + { + Assert.That(customers.Select(x => x.CustomerId).Distinct().ToList(), Has.Count.EqualTo(5)); + Assert.That(customers.Any(x => string.IsNullOrEmpty(x.FullName)), Is.False); + Assert.That(customers.Select(x => x.BirthDate).Distinct().ToList(), Has.Count.EqualTo(5)); + Assert.That(customers.Any(x => x.BirthDate == DateTime.MinValue), Is.False); + }); } [Test] @@ -340,9 +346,12 @@ public virtual void QueryCustomerWithDapperRepository() var repo = provider.GetRequiredService(); var customers = repo.GetAllAsync().Result; Assert.That(customers, Has.Count.EqualTo(5)); - Assert.That(customers.Select(x => x.CustomerId).Distinct().ToList(), Has.Count.EqualTo(5)); - Assert.That(customers.Any(x => string.IsNullOrEmpty(x.FullName)), Is.False); - Assert.That(customers.Select(x => x.BirthDate).Distinct().ToList(), Has.Count.EqualTo(5)); - Assert.That(customers.Any(x => x.BirthDate == DateTime.MinValue), Is.False); + Assert.Multiple(() => + { + Assert.That(customers.Select(x => x.CustomerId).Distinct().ToList(), Has.Count.EqualTo(5)); + Assert.That(customers.Any(x => string.IsNullOrEmpty(x.FullName)), Is.False); + Assert.That(customers.Select(x => x.BirthDate).Distinct().ToList(), Has.Count.EqualTo(5)); + Assert.That(customers.Any(x => x.BirthDate == DateTime.MinValue), Is.False); + }); } -} \ No newline at end of file +} diff --git a/DubUrl.QA/DubUrl.QA.csproj b/DubUrl.QA/DubUrl.QA.csproj index 7ac8a01b..10bcd1f8 100644 --- a/DubUrl.QA/DubUrl.QA.csproj +++ b/DubUrl.QA/DubUrl.QA.csproj @@ -93,7 +93,7 @@ - + diff --git a/DubUrl.Testing/DubUrl.Testing.csproj b/DubUrl.Testing/DubUrl.Testing.csproj index 2ecd1b53..c6629958 100644 --- a/DubUrl.Testing/DubUrl.Testing.csproj +++ b/DubUrl.Testing/DubUrl.Testing.csproj @@ -20,7 +20,7 @@ - + diff --git a/DubUrl.Testing/Locating/OdbcDriver/DriverLocatorFactoryTest.cs b/DubUrl.Testing/Locating/OdbcDriver/DriverLocatorFactoryTest.cs index 2691847f..46cdb6f6 100644 --- a/DubUrl.Testing/Locating/OdbcDriver/DriverLocatorFactoryTest.cs +++ b/DubUrl.Testing/Locating/OdbcDriver/DriverLocatorFactoryTest.cs @@ -47,8 +47,11 @@ public void Instantiate_MysqlWithEncoding_CorrectType(EncodingOption encoding) Assert.That(result, Is.Not.Null); Assert.That(result, Is.InstanceOf()); - Assert.That(result, Is.TypeOf()); - Assert.That(((MySqlConnectorDriverLocator)result).Encoding, Is.EqualTo(encoding)); + Assert.Multiple(() => + { + Assert.That(result, Is.TypeOf()); + Assert.That(((MySqlConnectorDriverLocator)result).Encoding, Is.EqualTo(encoding)); + }); } [Test] @@ -67,8 +70,11 @@ public void Instantiate_PostgresqlWithEncodingArchitecture_CorrectType(EncodingO Assert.That(result, Is.Not.Null); Assert.That(result, Is.InstanceOf()); - Assert.That(result, Is.TypeOf()); - Assert.That(((PostgresqlDriverLocator)result).Encoding, Is.EqualTo(encoding)); - Assert.That(((PostgresqlDriverLocator)result).Architecture, Is.EqualTo(architecture)); + Assert.Multiple(() => + { + Assert.That(result, Is.TypeOf()); + Assert.That(((PostgresqlDriverLocator)result).Encoding, Is.EqualTo(encoding)); + Assert.That(((PostgresqlDriverLocator)result).Architecture, Is.EqualTo(architecture)); + }); } } diff --git a/DubUrl.Testing/Locating/OdbcDriver/DriverLocatorIntrospectorTest.cs b/DubUrl.Testing/Locating/OdbcDriver/DriverLocatorIntrospectorTest.cs index 502a0e15..210997c6 100644 --- a/DubUrl.Testing/Locating/OdbcDriver/DriverLocatorIntrospectorTest.cs +++ b/DubUrl.Testing/Locating/OdbcDriver/DriverLocatorIntrospectorTest.cs @@ -15,8 +15,11 @@ public void Locate_RealTypes_BrandsAssociated() { var introspector = new DriverLocatorIntrospector(); var result = introspector.Locate(); - Assert.That(result.Any(x => !string.IsNullOrEmpty(x.Slug)), Is.True); - Assert.That(result.All(x => !string.IsNullOrEmpty(x.MainColor)), Is.True); - Assert.That(result.All(x => !string.IsNullOrEmpty(x.SecondaryColor)), Is.True); + Assert.Multiple(() => + { + Assert.That(result.Any(x => !string.IsNullOrEmpty(x.Slug)), Is.True); + Assert.That(result.All(x => !string.IsNullOrEmpty(x.MainColor)), Is.True); + Assert.That(result.All(x => !string.IsNullOrEmpty(x.SecondaryColor)), Is.True); + }); } } diff --git a/DubUrl.Testing/Locating/RegexUtils/AnyOfCapture.cs b/DubUrl.Testing/Locating/RegexUtils/AnyOfCapture.cs index 75f2949a..efa4e02c 100644 --- a/DubUrl.Testing/Locating/RegexUtils/AnyOfCapture.cs +++ b/DubUrl.Testing/Locating/RegexUtils/AnyOfCapture.cs @@ -18,8 +18,11 @@ public void ToRegex_String_Matching(string[] options, string text) { var regex = new AnyOfCapture(options); var result = Regex.Match(text, regex.ToRegex()); - Assert.That(result.Success, Is.True); - Assert.That(result.Groups[0].Captures[0].Value, Is.EqualTo(text)); + Assert.Multiple(() => + { + Assert.That(result.Success, Is.True); + Assert.That(result.Groups[0].Captures[0].Value, Is.EqualTo(text)); + }); } [Test] diff --git a/DubUrl.Testing/Locating/RegexUtils/CompositeRegex.cs b/DubUrl.Testing/Locating/RegexUtils/CompositeRegex.cs index c6d54cb5..1b61cea8 100644 --- a/DubUrl.Testing/Locating/RegexUtils/CompositeRegex.cs +++ b/DubUrl.Testing/Locating/RegexUtils/CompositeRegex.cs @@ -82,9 +82,12 @@ public void ToRegex_WordSpaceVersionSpaceAnyOfSpaceWord_ExpectedResult(string te { var regex = new CompositeRegex(new BaseRegex[] { new WordMatch("MariaDB"), new SpaceMatch(), new VersionCapture(), new SpaceMatch(), new AnyOfCapture(new[] { "ANSI", "Unicode" }), new SpaceMatch(), new WordMatch("Driver") }); var result = Regex.Match(text, regex.ToRegex()); - Assert.That(result.Success, Is.True); - Assert.That(result.Groups[1].Captures[0].Value, Is.EqualTo(version)); - Assert.That(result.Groups[2].Captures[0].Value, Is.EqualTo(encoding)); + Assert.Multiple(() => + { + Assert.That(result.Success, Is.True); + Assert.That(result.Groups[1].Captures[0].Value, Is.EqualTo(version)); + Assert.That(result.Groups[2].Captures[0].Value, Is.EqualTo(encoding)); + }); } diff --git a/DubUrl.Testing/Locating/RegexUtils/OptionalCapture.cs b/DubUrl.Testing/Locating/RegexUtils/OptionalCapture.cs index 5b30cd35..e39e8b46 100644 --- a/DubUrl.Testing/Locating/RegexUtils/OptionalCapture.cs +++ b/DubUrl.Testing/Locating/RegexUtils/OptionalCapture.cs @@ -19,7 +19,10 @@ public void ToRegex_String_Matching(string optional, string text, string capture { var regex = new OptionalCapture(optional); var result = Regex.Match(text, regex.ToRegex()); - Assert.That(result.Success, Is.True); - Assert.That(result.Groups[0].Captures[0].Value, Is.EqualTo(capture)); + Assert.Multiple(() => + { + Assert.That(result.Success, Is.True); + Assert.That(result.Groups[0].Captures[0].Value, Is.EqualTo(capture)); + }); } } diff --git a/DubUrl.Testing/Locating/RegexUtils/VersionCapture.cs b/DubUrl.Testing/Locating/RegexUtils/VersionCapture.cs index 67a3f5c6..153db34c 100644 --- a/DubUrl.Testing/Locating/RegexUtils/VersionCapture.cs +++ b/DubUrl.Testing/Locating/RegexUtils/VersionCapture.cs @@ -23,8 +23,11 @@ public void ToRegex_String_Matching(string text) { var regex = new VersionCapture(); var result = Regex.Match(text, regex.ToRegex()); - Assert.That(result.Success, Is.True); - Assert.That(result.Groups[0].Captures[0].Value, Is.EqualTo(text)); + Assert.Multiple(() => + { + Assert.That(result.Success, Is.True); + Assert.That(result.Groups[0].Captures[0].Value, Is.EqualTo(text)); + }); } [Test] diff --git a/DubUrl.Testing/Mapping/Implementation/PostgresqlMapperTest.cs b/DubUrl.Testing/Mapping/Implementation/PostgresqlMapperTest.cs index a4e90fdf..f3c2d8af 100644 --- a/DubUrl.Testing/Mapping/Implementation/PostgresqlMapperTest.cs +++ b/DubUrl.Testing/Mapping/Implementation/PostgresqlMapperTest.cs @@ -31,7 +31,7 @@ public void GetDialect_None_DialectReturned() var result = mapper.GetDialect(); Assert.That(result, Is.Not.Null.Or.Empty); - Assert.IsInstanceOf(result); + Assert.That(result, Is.InstanceOf()); Assert.That(result.Aliases, Does.Contain("pgsql")); Assert.That(result.Aliases, Does.Contain("pg")); } diff --git a/DubUrl.Testing/Mapping/Implementation/QuestDbMapperTest.cs b/DubUrl.Testing/Mapping/Implementation/QuestDbMapperTest.cs index f50f9011..93870a07 100644 --- a/DubUrl.Testing/Mapping/Implementation/QuestDbMapperTest.cs +++ b/DubUrl.Testing/Mapping/Implementation/QuestDbMapperTest.cs @@ -31,7 +31,7 @@ public void GetDialect_None_DialectReturned() var result = mapper.GetDialect(); Assert.That(result, Is.Not.Null.Or.Empty); - Assert.IsInstanceOf(result); + Assert.That(result, Is.InstanceOf()); Assert.That(result.Aliases, Does.Contain("quest")); Assert.That(result.Aliases, Does.Contain("questdb")); } diff --git a/DubUrl.Testing/Mapping/NativeMapperIntrospectorTest.cs b/DubUrl.Testing/Mapping/NativeMapperIntrospectorTest.cs index 54e72500..fab003b4 100644 --- a/DubUrl.Testing/Mapping/NativeMapperIntrospectorTest.cs +++ b/DubUrl.Testing/Mapping/NativeMapperIntrospectorTest.cs @@ -31,8 +31,11 @@ public void Locate_OneMapperClass_ClassReturned() var result = introspector.Locate(); Assert.That(result, Is.Not.Null); - Assert.That(result.Count(), Is.EqualTo(1)); - Assert.That(result.ElementAt(0).MapperType, Is.EqualTo(typeof(MsSqlServerMapper))); + Assert.Multiple(() => + { + Assert.That(result.Count(), Is.EqualTo(1)); + Assert.That(result.ElementAt(0).MapperType, Is.EqualTo(typeof(MsSqlServerMapper))); + }); } [Test] @@ -43,10 +46,13 @@ public void Locate_OneMapperClassWithBrand_ClassReturned() var result = introspector.Locate(); Assert.That(result, Is.Not.Null); - Assert.That(result.Count(), Is.EqualTo(1)); - Assert.That(result.ElementAt(0).Slug, Is.EqualTo("microsoftsqlserver")); - Assert.That(result.ElementAt(0).MainColor.Length, Is.EqualTo(7)); - Assert.That(result.ElementAt(0).SecondaryColor.Length, Is.EqualTo(7)); + Assert.Multiple(() => + { + Assert.That(result.Count(), Is.EqualTo(1)); + Assert.That(result.ElementAt(0).Slug, Is.EqualTo("microsoftsqlserver")); + Assert.That(result.ElementAt(0).MainColor.Length, Is.EqualTo(7)); + Assert.That(result.ElementAt(0).SecondaryColor.Length, Is.EqualTo(7)); + }); } [Test] @@ -68,8 +74,11 @@ public void Locate_TwoMapperClassesButOneAlternate_ClassesReturned() var result = introspector.Locate(); Assert.That(result, Is.Not.Null); - Assert.That(result.Count(), Is.EqualTo(1)); - Assert.That(result.ElementAt(0).MapperType, Is.EqualTo(typeof(MsSqlServerMapper))); + Assert.Multiple(() => + { + Assert.That(result.Count(), Is.EqualTo(1)); + Assert.That(result.ElementAt(0).MapperType, Is.EqualTo(typeof(MsSqlServerMapper))); + }); } [Test] @@ -80,8 +89,11 @@ public void LocateAlternative_TwoMapperClassesButOneAlternate_ClassesReturned() var result = introspector.LocateAlternative(); Assert.That(result, Is.Not.Null); - Assert.That(result.Count(), Is.EqualTo(1)); - Assert.That(result.ElementAt(0).MapperType, Is.EqualTo(typeof(MySqlDataMapper))); + Assert.Multiple(() => + { + Assert.That(result.Count(), Is.EqualTo(1)); + Assert.That(result.ElementAt(0).MapperType, Is.EqualTo(typeof(MySqlDataMapper))); + }); } [Test] @@ -92,8 +104,11 @@ public void Aliases_TwoMapperClassesIncludingAlternative_Equivalent() var alternative = introspector.LocateAlternative().ElementAt(0).Aliases; var primary = introspector.Locate().ElementAt(0).Aliases; - Assert.That(primary, Is.Not.Null.Or.Empty); - Assert.That(alternative, Is.Not.Null.Or.Empty); + Assert.Multiple(() => + { + Assert.That(primary, Is.Not.Null.Or.Empty); + Assert.That(alternative, Is.Not.Null.Or.Empty); + }); Assert.That(primary, Is.EqualTo(alternative)); } @@ -105,8 +120,11 @@ public void DatabaseName_TwoMapperClassesIncludingAlternative_Equivalent() var alternative = introspector.LocateAlternative().ElementAt(0).DatabaseName; var primary = introspector.Locate().ElementAt(0).DatabaseName; - Assert.That(primary, Is.Not.Null.Or.Empty); - Assert.That(alternative, Is.Not.Null.Or.Empty); + Assert.Multiple(() => + { + Assert.That(primary, Is.Not.Null.Or.Empty); + Assert.That(alternative, Is.Not.Null.Or.Empty); + }); Assert.That(primary, Is.EqualTo(alternative)); } } diff --git a/DubUrl.Testing/Mapping/SchemeMapperBuilderTest.cs b/DubUrl.Testing/Mapping/SchemeMapperBuilderTest.cs index 14553693..530ca431 100644 --- a/DubUrl.Testing/Mapping/SchemeMapperBuilderTest.cs +++ b/DubUrl.Testing/Mapping/SchemeMapperBuilderTest.cs @@ -33,10 +33,8 @@ public void DefaultRegistration() DbProviderFactories.RegisterFactory("FirebirdSql.Data.FirebirdClient", FirebirdSql.Data.FirebirdClient.FirebirdClientFactory.Instance); DbProviderFactories.RegisterFactory("System.Data.Odbc", System.Data.Odbc.OdbcFactory.Instance); DbProviderFactories.RegisterFactory("NReco.PrestoAdo", NReco.PrestoAdo.PrestoDbFactory.Instance); -#pragma warning disable CA1416 // Validate platform compatibility if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) DbProviderFactories.RegisterFactory("System.Data.OleDb", System.Data.OleDb.OleDbFactory.Instance); -#pragma warning restore CA1416 // Validate platform compatibility } private class StubMapper : BaseMapper @@ -168,7 +166,10 @@ public void ReplaceDriverLocationFactory_NewDriverLocationFactory_CorrectType() builder.Build(); var result = builder.GetMapper(new[] { "odbc", "foobar" }); Assert.That(result, Is.Not.Null); - Assert.That(result, Is.TypeOf()); - Assert.That(((OdbcRewriter)result).DriverLocatorFactory, Is.EqualTo(factory)); + Assert.Multiple(() => + { + Assert.That(result, Is.TypeOf()); + Assert.That(((OdbcRewriter)result).DriverLocatorFactory, Is.EqualTo(factory)); + }); } } diff --git a/DubUrl.Testing/Mapping/WrapperMapperIntrospectorTest.cs b/DubUrl.Testing/Mapping/WrapperMapperIntrospectorTest.cs index 6311a02a..e4d1f365 100644 --- a/DubUrl.Testing/Mapping/WrapperMapperIntrospectorTest.cs +++ b/DubUrl.Testing/Mapping/WrapperMapperIntrospectorTest.cs @@ -36,8 +36,11 @@ public void LocateWrapper_OneWrapperMapperClassesForOneDatabase_WrapperReturned( var result = introspector.Locate(); Assert.That(result, Is.Not.Null); - Assert.That(result.Count(), Is.EqualTo(1)); - Assert.That(result.ElementAt(0).MapperType, Is.EqualTo(typeof(OdbcMapper))); + Assert.Multiple(() => + { + Assert.That(result.Count(), Is.EqualTo(1)); + Assert.That(result.ElementAt(0).MapperType, Is.EqualTo(typeof(OdbcMapper))); + }); } [Test] @@ -51,9 +54,12 @@ public void LocateWrapper_OneWrapperMapperClassesForTwoDatabases_WrapperReturned var result = introspector.Locate(); Assert.That(result, Is.Not.Null); - Assert.That(result.Count(), Is.EqualTo(2)); - Assert.That(result.ElementAt(0).MapperType, Is.EqualTo(typeof(OdbcMapper))); - Assert.That(result.ElementAt(1).MapperType, Is.EqualTo(typeof(OdbcMapper))); + Assert.Multiple(() => + { + Assert.That(result.Count(), Is.EqualTo(2)); + Assert.That(result.ElementAt(0).MapperType, Is.EqualTo(typeof(OdbcMapper))); + Assert.That(result.ElementAt(1).MapperType, Is.EqualTo(typeof(OdbcMapper))); + }); } [Test] @@ -80,8 +86,11 @@ public void Locate_RealTypes_BrandsAssociated() { var introspector = new WrapperMapperIntrospector(); var result = introspector.Locate(); - Assert.That(result.Any(x => !string.IsNullOrEmpty(x.Slug)), Is.True); - Assert.That(result.All(x => !string.IsNullOrEmpty(x.MainColor)), Is.True); - Assert.That(result.All(x => !string.IsNullOrEmpty(x.SecondaryColor)), Is.True); + Assert.Multiple(() => + { + Assert.That(result.Any(x => !string.IsNullOrEmpty(x.Slug)), Is.True); + Assert.That(result.All(x => !string.IsNullOrEmpty(x.MainColor)), Is.True); + Assert.That(result.All(x => !string.IsNullOrEmpty(x.SecondaryColor)), Is.True); + }); } } diff --git a/DubUrl.Testing/MicroOrm/ReflectionCacheTest.cs b/DubUrl.Testing/MicroOrm/ReflectionCacheTest.cs index fd75623f..22ac9bae 100644 --- a/DubUrl.Testing/MicroOrm/ReflectionCacheTest.cs +++ b/DubUrl.Testing/MicroOrm/ReflectionCacheTest.cs @@ -37,11 +37,17 @@ public void Clear_Any_NotAvailable() public void Exists_Any_False() { var cache = new ReflectionCache(); - Assert.That(cache.Exists(), Is.False); - Assert.That(cache.Exists(), Is.False); + Assert.Multiple(() => + { + Assert.That(cache.Exists(), Is.False); + Assert.That(cache.Exists(), Is.False); + }); cache.Add(Array.Empty(), Array.Empty()); - Assert.That(cache.Exists(), Is.True); - Assert.That(cache.Exists(), Is.False); + Assert.Multiple(() => + { + Assert.That(cache.Exists(), Is.True); + Assert.That(cache.Exists(), Is.False); + }); } [Test] @@ -51,8 +57,11 @@ public void Get_Any_ThrowsNotImplemented() cache.Add(Array.Empty(), Array.Empty()); cache.Add(Array.Empty(), Array.Empty()); var (x, y) = cache.Get(); - Assert.That(x, Is.Not.Null); - Assert.That(y, Is.Not.Null); + Assert.Multiple(() => + { + Assert.That(x, Is.Not.Null); + Assert.That(y, Is.Not.Null); + }); } [Test] @@ -62,7 +71,10 @@ public void Remove_Any_DoesNotThrow() cache.Add(Array.Empty(), Array.Empty()); cache.Add(Array.Empty(), Array.Empty()); cache.Remove(); - Assert.That(cache.Exists(), Is.False); - Assert.That(cache.Exists(), Is.True); + Assert.Multiple(() => + { + Assert.That(cache.Exists(), Is.False); + Assert.That(cache.Exists(), Is.True); + }); } } diff --git a/DubUrl.Testing/Parsing/ParserTest.cs b/DubUrl.Testing/Parsing/ParserTest.cs index 4ff23d1a..7124a260 100644 --- a/DubUrl.Testing/Parsing/ParserTest.cs +++ b/DubUrl.Testing/Parsing/ParserTest.cs @@ -83,8 +83,11 @@ public void Url_Parser_UserInfoParsed(string url, string username = "user", stri var parser = new Parser(); var result = parser.Parse(url); Assert.That(result, Is.Not.Null); - Assert.That(result.Username, Is.EqualTo(username)); - Assert.That(result.Password, Is.EqualTo(password)); + Assert.Multiple(() => + { + Assert.That(result.Username, Is.EqualTo(username)); + Assert.That(result.Password, Is.EqualTo(password)); + }); } [Test] @@ -95,8 +98,11 @@ public void UrlWithoutUserInfo_Parser_UserAndPasswordEmpty(string url) var parser = new Parser(); var result = parser.Parse(url); Assert.That(result, Is.Not.Null); - Assert.That(result.Username, Is.Null.Or.Empty); - Assert.That(result.Password, Is.Null.Or.Empty); + Assert.Multiple(() => + { + Assert.That(result.Username, Is.Null.Or.Empty); + Assert.That(result.Password, Is.Null.Or.Empty); + }); } [Test] @@ -121,8 +127,11 @@ public void Parse_EmptyHost_HostWithoutSegment() var parser = new Parser(); var result = parser.Parse("sqlite://data.db"); Assert.That(result, Is.Not.Null); - Assert.That(result.Host, Is.EqualTo("data.db")); - Assert.That(result.Segments.Length, Is.EqualTo(0)); + Assert.Multiple(() => + { + Assert.That(result.Host, Is.EqualTo("data.db")); + Assert.That(result.Segments.Length, Is.EqualTo(0)); + }); } [Test] @@ -131,8 +140,11 @@ public void Parse_EmptyHost_EmptyHost() var parser = new Parser(); var result = parser.Parse("sqlite:///data.db"); Assert.That(result, Is.Not.Null); - Assert.That(result.Host, Is.Null.Or.Empty); - Assert.That(result.Segments.Length, Is.EqualTo(1)); + Assert.Multiple(() => + { + Assert.That(result.Host, Is.Null.Or.Empty); + Assert.That(result.Segments.Length, Is.EqualTo(1)); + }); Assert.That(result.Segments[0], Is.EqualTo("data.db")); } @@ -142,10 +154,16 @@ public void Parse_EmptyHostAndFirstSegment_EmptyHostAndFirstSegment() var parser = new Parser(); var result = parser.Parse("sqlite:////c:/data.db"); Assert.That(result, Is.Not.Null); - Assert.That(result.Host, Is.Null.Or.Empty); - Assert.That(result.Segments.Length, Is.EqualTo(3)); - Assert.That(result.Segments[0], Is.Null.Or.Empty); - Assert.That(result.Segments[1], Is.EqualTo("c:")); - Assert.That(result.Segments[2], Is.EqualTo("data.db")); + Assert.Multiple(() => + { + Assert.That(result.Host, Is.Null.Or.Empty); + Assert.That(result.Segments.Length, Is.EqualTo(3)); + }); + Assert.Multiple(() => + { + Assert.That(result.Segments[0], Is.Null.Or.Empty); + Assert.That(result.Segments[1], Is.EqualTo("c:")); + Assert.That(result.Segments[2], Is.EqualTo("data.db")); + }); } } \ No newline at end of file diff --git a/DubUrl.Testing/Querying/Dialects/DialectBuilderTest.cs b/DubUrl.Testing/Querying/Dialects/DialectBuilderTest.cs index 64abb4ec..f3dbf687 100644 --- a/DubUrl.Testing/Querying/Dialects/DialectBuilderTest.cs +++ b/DubUrl.Testing/Querying/Dialects/DialectBuilderTest.cs @@ -95,8 +95,11 @@ public void Get_TwiceTheSameDialect_AreEqual() builder.Build(); var firstDialect = builder.Get("ms"); var secondDialect = builder.Get(); - Assert.That(firstDialect, Is.Not.Null); - Assert.That(secondDialect, Is.Not.Null); + Assert.Multiple(() => + { + Assert.That(firstDialect, Is.Not.Null); + Assert.That(secondDialect, Is.Not.Null); + }); Assert.That(firstDialect, Is.EqualTo(secondDialect)); } diff --git a/DubUrl.Testing/Registering/BinFolderDiscovererTest.cs b/DubUrl.Testing/Registering/BinFolderDiscovererTest.cs index 7c28a2b9..e522316a 100644 --- a/DubUrl.Testing/Registering/BinFolderDiscovererTest.cs +++ b/DubUrl.Testing/Registering/BinFolderDiscovererTest.cs @@ -18,8 +18,11 @@ public void Execute_CurrentAssembly_ExpectedMembers() Assert.That(types, Is.Not.Null); Assert.That(types, Is.Not.Empty); Assert.That(types.Select(x => x.Name), Does.Contain("NpgsqlFactory")); - Assert.That(types.Select(x => x.Name), Does.Contain("SqlClientFactory")); - Assert.That(types.Select(x => x.FullName), Does.Contain("Npgsql.NpgsqlFactory")); + Assert.Multiple(() => + { + Assert.That(types.Select(x => x.Name), Does.Contain("SqlClientFactory")); + Assert.That(types.Select(x => x.FullName), Does.Contain("Npgsql.NpgsqlFactory")); + }); Assert.That(types.Select(x => x.FullName), Does.Contain("Microsoft.Data.SqlClient.SqlClientFactory")); } } diff --git a/DubUrl.Testing/Registering/ProviderFactoriesRegistratorTest.cs b/DubUrl.Testing/Registering/ProviderFactoriesRegistratorTest.cs index e3fcbc64..3129d18e 100644 --- a/DubUrl.Testing/Registering/ProviderFactoriesRegistratorTest.cs +++ b/DubUrl.Testing/Registering/ProviderFactoriesRegistratorTest.cs @@ -51,8 +51,11 @@ public void Register_FakeDbProviderFactory_Registered() var registrator = new ProviderFactoriesRegistrator(discoverMock.Object); registrator.Register(); - Assert.That(DbProviderFactories.TryGetFactory(GetType().Assembly.GetName().Name ?? throw new ArgumentException(), out var factory), Is.True); - Assert.That(factory, Is.TypeOf()); + Assert.Multiple(() => + { + Assert.That(DbProviderFactories.TryGetFactory(GetType().Assembly.GetName().Name ?? throw new ArgumentException(), out var factory), Is.True); + Assert.That(factory, Is.TypeOf()); + }); } [TearDown] diff --git a/DubUrl.Testing/Rewriting/Implementation/CockRoachRewriterTest.cs b/DubUrl.Testing/Rewriting/Implementation/CockRoachRewriterTest.cs index 543a922a..90e5e82b 100644 --- a/DubUrl.Testing/Rewriting/Implementation/CockRoachRewriterTest.cs +++ b/DubUrl.Testing/Rewriting/Implementation/CockRoachRewriterTest.cs @@ -83,8 +83,11 @@ public void Map_UrlInfoWithUsernamePassword_Authentication() Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey(PostgresqlRewriter.USERNAME_KEYWORD)); - Assert.That(result[PostgresqlRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); - Assert.That(result, Does.ContainKey(PostgresqlRewriter.PASSWORD_KEYWORD)); + Assert.Multiple(() => + { + Assert.That(result[PostgresqlRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); + Assert.That(result, Does.ContainKey(PostgresqlRewriter.PASSWORD_KEYWORD)); + }); Assert.That(result[PostgresqlRewriter.PASSWORD_KEYWORD], Is.EqualTo("pwd")); if (rewriter.IsIntegratedSecurityAllowed) { @@ -126,8 +129,11 @@ public void UrlInfo_Map_Options() Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey("Application Name")); - Assert.That(result["Application Name"], Is.EqualTo("myApp")); - Assert.That(result, Does.ContainKey("Persist Security Info")); + Assert.Multiple(() => + { + Assert.That(result["Application Name"], Is.EqualTo("myApp")); + Assert.That(result, Does.ContainKey("Persist Security Info")); + }); Assert.That(result["Persist Security Info"], Is.True); } } diff --git a/DubUrl.Testing/Rewriting/Implementation/Db2RewriterTest.cs b/DubUrl.Testing/Rewriting/Implementation/Db2RewriterTest.cs index c3bb72cf..addd1bfe 100644 --- a/DubUrl.Testing/Rewriting/Implementation/Db2RewriterTest.cs +++ b/DubUrl.Testing/Rewriting/Implementation/Db2RewriterTest.cs @@ -58,8 +58,11 @@ public void Map_UrlInfoWithUsernamePassword_Authentication(string segmentsList = Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey(Db2Rewriter.USERNAME_KEYWORD)); - Assert.That(result[Db2Rewriter.USERNAME_KEYWORD], Is.EqualTo("user")); - Assert.That(result, Does.ContainKey(Db2Rewriter.PASSWORD_KEYWORD)); + Assert.Multiple(() => + { + Assert.That(result[Db2Rewriter.USERNAME_KEYWORD], Is.EqualTo("user")); + Assert.That(result, Does.ContainKey(Db2Rewriter.PASSWORD_KEYWORD)); + }); Assert.That(result[Db2Rewriter.PASSWORD_KEYWORD], Is.EqualTo("pwd")); } } \ No newline at end of file diff --git a/DubUrl.Testing/Rewriting/Implementation/DrillOdbcRewriterTest.cs b/DubUrl.Testing/Rewriting/Implementation/DrillOdbcRewriterTest.cs index 04b4e694..af09610c 100644 --- a/DubUrl.Testing/Rewriting/Implementation/DrillOdbcRewriterTest.cs +++ b/DubUrl.Testing/Rewriting/Implementation/DrillOdbcRewriterTest.cs @@ -28,9 +28,12 @@ public void Map_UrlInfo_ReturnsServer(string host, string expected) Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey(DrillOdbcRewriter.SERVER_KEYWORD)); - Assert.That(result[DrillOdbcRewriter.SERVER_KEYWORD], Is.EqualTo(expected)); - Assert.That(result[DrillOdbcRewriter.CONNECTION_KEYWORD], Is.EqualTo("Direct")); - Assert.That(result, Does.Not.ContainKey(DrillOdbcRewriter.ZKQUORUM_KEYWORD)); + Assert.Multiple(() => + { + Assert.That(result[DrillOdbcRewriter.SERVER_KEYWORD], Is.EqualTo(expected)); + Assert.That(result[DrillOdbcRewriter.CONNECTION_KEYWORD], Is.EqualTo("Direct")); + Assert.That(result, Does.Not.ContainKey(DrillOdbcRewriter.ZKQUORUM_KEYWORD)); + }); } @@ -46,8 +49,11 @@ public void Map_UrlInfo_ReturnsZkQuorum(string host, string expected) Assert.That(result, Is.Not.Null); Assert.That(result, Does.Not.ContainKey(DrillOdbcRewriter.SERVER_KEYWORD)); Assert.That(result, Does.ContainKey(DrillOdbcRewriter.ZKQUORUM_KEYWORD)); - Assert.That(result[DrillOdbcRewriter.ZKQUORUM_KEYWORD], Is.EqualTo(expected)); - Assert.That(result[DrillOdbcRewriter.CONNECTION_KEYWORD], Is.EqualTo("ZooKeeper")); + Assert.Multiple(() => + { + Assert.That(result[DrillOdbcRewriter.ZKQUORUM_KEYWORD], Is.EqualTo(expected)); + Assert.That(result[DrillOdbcRewriter.CONNECTION_KEYWORD], Is.EqualTo("ZooKeeper")); + }); } [Test] @@ -89,10 +95,16 @@ public void Map_UrlInfoWithUsernamePassword_Authentication() Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey(DrillOdbcRewriter.USERNAME_KEYWORD)); - Assert.That(result[DrillOdbcRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); - Assert.That(result, Does.ContainKey(DrillOdbcRewriter.PASSWORD_KEYWORD)); - Assert.That(result[DrillOdbcRewriter.PASSWORD_KEYWORD], Is.EqualTo("pwd")); - Assert.That(result, Does.ContainKey(DrillOdbcRewriter.AUTHENTICATION_KEYWORD)); + Assert.Multiple(() => + { + Assert.That(result[DrillOdbcRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); + Assert.That(result, Does.ContainKey(DrillOdbcRewriter.PASSWORD_KEYWORD)); + }); + Assert.Multiple(() => + { + Assert.That(result[DrillOdbcRewriter.PASSWORD_KEYWORD], Is.EqualTo("pwd")); + Assert.That(result, Does.ContainKey(DrillOdbcRewriter.AUTHENTICATION_KEYWORD)); + }); Assert.That(result[DrillOdbcRewriter.AUTHENTICATION_KEYWORD], Is.EqualTo("Plain")); } diff --git a/DubUrl.Testing/Rewriting/Implementation/FirebirdSqlRewriterTest.cs b/DubUrl.Testing/Rewriting/Implementation/FirebirdSqlRewriterTest.cs index 10e49e5d..e6c84e79 100644 --- a/DubUrl.Testing/Rewriting/Implementation/FirebirdSqlRewriterTest.cs +++ b/DubUrl.Testing/Rewriting/Implementation/FirebirdSqlRewriterTest.cs @@ -49,8 +49,11 @@ public void Map_DoubleSlash_Database(string host, string expected = "data.fdb") Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey(FirebirdSqlRewriter.SERVER_KEYWORD)); - Assert.That(result[FirebirdSqlRewriter.SERVER_KEYWORD], Is.EqualTo("localhost")); - Assert.That(result, Does.ContainKey(FirebirdSqlRewriter.DATABASE_KEYWORD)); + Assert.Multiple(() => + { + Assert.That(result[FirebirdSqlRewriter.SERVER_KEYWORD], Is.EqualTo("localhost")); + Assert.That(result, Does.ContainKey(FirebirdSqlRewriter.DATABASE_KEYWORD)); + }); Assert.That(result[FirebirdSqlRewriter.DATABASE_KEYWORD], Is.EqualTo(expected)); } @@ -93,8 +96,11 @@ public void Map_UrlInfoWithUsernamePassword_Authentication() Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey(FirebirdSqlRewriter.USERNAME_KEYWORD)); - Assert.That(result[FirebirdSqlRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); - Assert.That(result, Does.ContainKey(FirebirdSqlRewriter.PASSWORD_KEYWORD)); + Assert.Multiple(() => + { + Assert.That(result[FirebirdSqlRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); + Assert.That(result, Does.ContainKey(FirebirdSqlRewriter.PASSWORD_KEYWORD)); + }); Assert.That(result[FirebirdSqlRewriter.PASSWORD_KEYWORD], Is.EqualTo("pwd")); } diff --git a/DubUrl.Testing/Rewriting/Implementation/MySqlConnectorRewriterTest.cs b/DubUrl.Testing/Rewriting/Implementation/MySqlConnectorRewriterTest.cs index 7c187246..127508ca 100644 --- a/DubUrl.Testing/Rewriting/Implementation/MySqlConnectorRewriterTest.cs +++ b/DubUrl.Testing/Rewriting/Implementation/MySqlConnectorRewriterTest.cs @@ -53,10 +53,16 @@ public void Map_UrlInfoWithUsernamePassword_Authentication() Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey(MySqlConnectorRewriter.USERNAME_KEYWORD)); - Assert.That(result[MySqlConnectorRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); - Assert.That(result, Does.ContainKey(MySqlConnectorRewriter.PASSWORD_KEYWORD)); - Assert.That(result[MySqlConnectorRewriter.PASSWORD_KEYWORD], Is.EqualTo("pwd")); - Assert.That(result, Does.Not.ContainKey("Integrated Security")); + Assert.Multiple(() => + { + Assert.That(result[MySqlConnectorRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); + Assert.That(result, Does.ContainKey(MySqlConnectorRewriter.PASSWORD_KEYWORD)); + }); + Assert.Multiple(() => + { + Assert.That(result[MySqlConnectorRewriter.PASSWORD_KEYWORD], Is.EqualTo("pwd")); + Assert.That(result, Does.Not.ContainKey("Integrated Security")); + }); } [Test] @@ -79,8 +85,11 @@ public void Map_UrlInfo_Options() Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey("Application Name")); - Assert.That(result["Application Name"], Is.EqualTo("myApp")); - Assert.That(result, Does.ContainKey("Persist Security Info")); + Assert.Multiple(() => + { + Assert.That(result["Application Name"], Is.EqualTo("myApp")); + Assert.That(result, Does.ContainKey("Persist Security Info")); + }); Assert.That(result["Persist Security Info"], Is.True); } } diff --git a/DubUrl.Testing/Rewriting/Implementation/MySqlDataRewriterTest.cs b/DubUrl.Testing/Rewriting/Implementation/MySqlDataRewriterTest.cs index b997fe3f..b464f8cb 100644 --- a/DubUrl.Testing/Rewriting/Implementation/MySqlDataRewriterTest.cs +++ b/DubUrl.Testing/Rewriting/Implementation/MySqlDataRewriterTest.cs @@ -52,10 +52,16 @@ public void Map_UrlInfoWithUsernamePassword_Authentication() Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey(MySqlDataRewriter.USERNAME_KEYWORD)); - Assert.That(result[MySqlDataRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); - Assert.That(result, Does.ContainKey(MySqlDataRewriter.PASSWORD_KEYWORD)); - Assert.That(result[MySqlDataRewriter.PASSWORD_KEYWORD], Is.EqualTo("pwd")); - Assert.That(result, Does.Not.ContainKey("Integrated Security")); + Assert.Multiple(() => + { + Assert.That(result[MySqlDataRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); + Assert.That(result, Does.ContainKey(MySqlDataRewriter.PASSWORD_KEYWORD)); + }); + Assert.Multiple(() => + { + Assert.That(result[MySqlDataRewriter.PASSWORD_KEYWORD], Is.EqualTo("pwd")); + Assert.That(result, Does.Not.ContainKey("Integrated Security")); + }); } [Test] @@ -78,8 +84,11 @@ public void Map_UrlInfo_Options() Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey("certificatefile")); - Assert.That(result["certificatefile"], Is.EqualTo("myCert")); - Assert.That(result, Does.ContainKey("persistsecurityinfo")); + Assert.Multiple(() => + { + Assert.That(result["certificatefile"], Is.EqualTo("myCert")); + Assert.That(result, Does.ContainKey("persistsecurityinfo")); + }); Assert.That(result["persistsecurityinfo"], Is.True); } } diff --git a/DubUrl.Testing/Rewriting/Implementation/OdbcDbqRewriterTest.cs b/DubUrl.Testing/Rewriting/Implementation/OdbcDbqRewriterTest.cs index 8b76de03..81beb8e1 100644 --- a/DubUrl.Testing/Rewriting/Implementation/OdbcDbqRewriterTest.cs +++ b/DubUrl.Testing/Rewriting/Implementation/OdbcDbqRewriterTest.cs @@ -71,8 +71,11 @@ public void Map_UrlInfoWithUsernamePassword_Authentication() Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey(OdbcDbqRewriter.USERNAME_KEYWORD)); - Assert.That(result[OdbcDbqRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); - Assert.That(result, Does.ContainKey(OdbcDbqRewriter.PASSWORD_KEYWORD)); + Assert.Multiple(() => + { + Assert.That(result[OdbcDbqRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); + Assert.That(result, Does.ContainKey(OdbcDbqRewriter.PASSWORD_KEYWORD)); + }); Assert.That(result[OdbcDbqRewriter.PASSWORD_KEYWORD], Is.EqualTo("pwd")); } @@ -88,8 +91,11 @@ public void Map_OptionsContainsOptions_OptionsReturned() Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey("sslmode")); - Assert.That(result["sslmode"], Is.EqualTo("required")); - Assert.That(result, Does.ContainKey("charset")); + Assert.Multiple(() => + { + Assert.That(result["sslmode"], Is.EqualTo("required")); + Assert.That(result, Does.ContainKey("charset")); + }); Assert.That(result["charset"], Is.EqualTo("UTF8")); } diff --git a/DubUrl.Testing/Rewriting/Implementation/OdbcRewriterTest.cs b/DubUrl.Testing/Rewriting/Implementation/OdbcRewriterTest.cs index d475aab0..8d977b04 100644 --- a/DubUrl.Testing/Rewriting/Implementation/OdbcRewriterTest.cs +++ b/DubUrl.Testing/Rewriting/Implementation/OdbcRewriterTest.cs @@ -57,8 +57,11 @@ public void Map_UrlInfoWithUsernamePassword_Authentication() Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey(OdbcRewriter.USERNAME_KEYWORD)); - Assert.That(result[OdbcRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); - Assert.That(result, Does.ContainKey(OdbcRewriter.PASSWORD_KEYWORD)); + Assert.Multiple(() => + { + Assert.That(result[OdbcRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); + Assert.That(result, Does.ContainKey(OdbcRewriter.PASSWORD_KEYWORD)); + }); Assert.That(result[OdbcRewriter.PASSWORD_KEYWORD], Is.EqualTo("pwd")); } @@ -74,8 +77,11 @@ public void Map_OptionsContainsOptions_OptionsReturned() Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey("sslmode")); - Assert.That(result["sslmode"], Is.EqualTo("required")); - Assert.That(result, Does.ContainKey("charset")); + Assert.Multiple(() => + { + Assert.That(result["sslmode"], Is.EqualTo("required")); + Assert.That(result, Does.ContainKey("charset")); + }); Assert.That(result["charset"], Is.EqualTo("UTF8")); } diff --git a/DubUrl.Testing/Rewriting/Implementation/OracleManagedDataAccessRewriterTest.cs b/DubUrl.Testing/Rewriting/Implementation/OracleManagedDataAccessRewriterTest.cs index 1544b6f3..aea4deec 100644 --- a/DubUrl.Testing/Rewriting/Implementation/OracleManagedDataAccessRewriterTest.cs +++ b/DubUrl.Testing/Rewriting/Implementation/OracleManagedDataAccessRewriterTest.cs @@ -28,9 +28,12 @@ public void Map_UrlInfo_DataSource(string expected, string host = "host", string var Rewriter = new OracleManagedDataAccessRewriter(ConnectionStringBuilder); var result = Rewriter.Execute(urlInfo); - Assert.That(result, Is.Not.Null); - Assert.That((IReadOnlyDictionary)result, Does.ContainKey(OracleManagedDataAccessRewriter.DATASOURCE_KEYWORD)); - Assert.That((object)result[OracleManagedDataAccessRewriter.DATASOURCE_KEYWORD], Is.EqualTo(expected)); + Assert.Multiple(() => + { + Assert.That(result, Is.Not.Null); + Assert.That((IReadOnlyDictionary)result, Does.ContainKey(OracleManagedDataAccessRewriter.DATASOURCE_KEYWORD)); + Assert.That((object)result[OracleManagedDataAccessRewriter.DATASOURCE_KEYWORD], Is.EqualTo(expected)); + }); } [Test] @@ -40,9 +43,12 @@ public void Map_UrlInfoWithUsernamePassword_Authentication() var Rewriter = new OracleManagedDataAccessRewriter(ConnectionStringBuilder); var result = Rewriter.Execute(urlInfo); - Assert.That(result, Is.Not.Null); - Assert.That((IReadOnlyDictionary)result, Does.ContainKey(OracleManagedDataAccessRewriter.USERNAME_KEYWORD)); - Assert.That((object)result[OracleManagedDataAccessRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); + Assert.Multiple(() => + { + Assert.That(result, Is.Not.Null); + Assert.That((IReadOnlyDictionary)result, Does.ContainKey(OracleManagedDataAccessRewriter.USERNAME_KEYWORD)); + Assert.That((object)result[OracleManagedDataAccessRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); + }); Assert.That((IReadOnlyDictionary)result, Does.ContainKey(OracleManagedDataAccessRewriter.PASSWORD_KEYWORD)); Assert.That((object)result[OracleManagedDataAccessRewriter.PASSWORD_KEYWORD], Is.EqualTo("pwd")); Assert.That(result, Does.Not.ContainKey("INTEGRATED SECURITY")); @@ -55,9 +61,12 @@ public void Map_UrlInfoWithoutUsernamePassword_Authentication() var Rewriter = new OracleManagedDataAccessRewriter(ConnectionStringBuilder); var result = Rewriter.Execute(urlInfo); - Assert.That(result, Is.Not.Null); - Assert.That((IReadOnlyDictionary)result, Does.ContainKey(OracleManagedDataAccessRewriter.USERNAME_KEYWORD)); - Assert.That((object)result[OracleManagedDataAccessRewriter.USERNAME_KEYWORD], Is.EqualTo("/")); + Assert.Multiple(() => + { + Assert.That(result, Is.Not.Null); + Assert.That((IReadOnlyDictionary)result, Does.ContainKey(OracleManagedDataAccessRewriter.USERNAME_KEYWORD)); + Assert.That((object)result[OracleManagedDataAccessRewriter.USERNAME_KEYWORD], Is.EqualTo("/")); + }); Assert.That((IReadOnlyDictionary)result, Does.ContainKey(OracleManagedDataAccessRewriter.PASSWORD_KEYWORD)); Assert.That((object)result[OracleManagedDataAccessRewriter.PASSWORD_KEYWORD], Is.Empty); } @@ -74,8 +83,11 @@ public void Map_UrlInfo_Options() Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey("STATEMENT CACHE SIZE")); - Assert.That(result["STATEMENT CACHE SIZE"], Is.EqualTo(100)); - Assert.That(result, Does.ContainKey("PERSIST SECURITY INFO")); + Assert.Multiple(() => + { + Assert.That(result["STATEMENT CACHE SIZE"], Is.EqualTo(100)); + Assert.That(result, Does.ContainKey("PERSIST SECURITY INFO")); + }); Assert.That(result["PERSIST SECURITY INFO"], Is.True); } } diff --git a/DubUrl.Testing/Rewriting/Implementation/PostgresqlRewriterTest.cs b/DubUrl.Testing/Rewriting/Implementation/PostgresqlRewriterTest.cs index ddb5270d..98113fcd 100644 --- a/DubUrl.Testing/Rewriting/Implementation/PostgresqlRewriterTest.cs +++ b/DubUrl.Testing/Rewriting/Implementation/PostgresqlRewriterTest.cs @@ -65,8 +65,11 @@ public void Map_UrlInfoWithUsernamePassword_Authentication() Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey(PostgresqlRewriter.USERNAME_KEYWORD)); - Assert.That(result[PostgresqlRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); - Assert.That(result, Does.ContainKey(PostgresqlRewriter.PASSWORD_KEYWORD)); + Assert.Multiple(() => + { + Assert.That(result[PostgresqlRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); + Assert.That(result, Does.ContainKey(PostgresqlRewriter.PASSWORD_KEYWORD)); + }); Assert.That(result[PostgresqlRewriter.PASSWORD_KEYWORD], Is.EqualTo("pwd")); if (Rewriter.IsIntegratedSecurityAllowed) { @@ -108,8 +111,11 @@ public void Map_UrlInfo_Options() Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey("Application Name")); - Assert.That(result["Application Name"], Is.EqualTo("myApp")); - Assert.That(result, Does.ContainKey("Persist Security Info")); + Assert.Multiple(() => + { + Assert.That(result["Application Name"], Is.EqualTo("myApp")); + Assert.That(result, Does.ContainKey("Persist Security Info")); + }); Assert.That(result["Persist Security Info"], Is.True); } diff --git a/DubUrl.Testing/Rewriting/Implementation/QuestDbRewriterTest.cs b/DubUrl.Testing/Rewriting/Implementation/QuestDbRewriterTest.cs index 57258adf..be9aedd5 100644 --- a/DubUrl.Testing/Rewriting/Implementation/QuestDbRewriterTest.cs +++ b/DubUrl.Testing/Rewriting/Implementation/QuestDbRewriterTest.cs @@ -75,8 +75,11 @@ public void Map_UrlInfoWithUsernamePassword_Authentication() Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey(QuestDbRewriter.USERNAME_KEYWORD)); - Assert.That(result[QuestDbRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); - Assert.That(result, Does.ContainKey(QuestDbRewriter.PASSWORD_KEYWORD)); + Assert.Multiple(() => + { + Assert.That(result[QuestDbRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); + Assert.That(result, Does.ContainKey(QuestDbRewriter.PASSWORD_KEYWORD)); + }); Assert.That(result[QuestDbRewriter.PASSWORD_KEYWORD], Is.EqualTo("pwd")); } diff --git a/DubUrl.Testing/Rewriting/Implementation/SnowflakeRewriterTest.cs b/DubUrl.Testing/Rewriting/Implementation/SnowflakeRewriterTest.cs index 197853a5..eb286177 100644 --- a/DubUrl.Testing/Rewriting/Implementation/SnowflakeRewriterTest.cs +++ b/DubUrl.Testing/Rewriting/Implementation/SnowflakeRewriterTest.cs @@ -69,8 +69,11 @@ public void Map_UrlInfoWithSchema_DatabaseAndSchema() Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey(SnowflakeRewriter.DATABASE_KEYWORD)); - Assert.That(result[SnowflakeRewriter.DATABASE_KEYWORD], Is.EqualTo("db")); - Assert.That(result, Does.ContainKey(SnowflakeRewriter.SCHEMA_KEYWORD)); + Assert.Multiple(() => + { + Assert.That(result[SnowflakeRewriter.DATABASE_KEYWORD], Is.EqualTo("db")); + Assert.That(result, Does.ContainKey(SnowflakeRewriter.SCHEMA_KEYWORD)); + }); Assert.That(result[SnowflakeRewriter.SCHEMA_KEYWORD], Is.EqualTo("schema")); } @@ -94,8 +97,11 @@ public void Map_UrlInfoWithUsernamePassword_Authentication() Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey(SnowflakeRewriter.USERNAME_KEYWORD)); - Assert.That(result[SnowflakeRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); - Assert.That(result, Does.ContainKey(SnowflakeRewriter.PASSWORD_KEYWORD)); + Assert.Multiple(() => + { + Assert.That(result[SnowflakeRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); + Assert.That(result, Does.ContainKey(SnowflakeRewriter.PASSWORD_KEYWORD)); + }); Assert.That(result[SnowflakeRewriter.PASSWORD_KEYWORD], Is.EqualTo("pwd")); } } \ No newline at end of file diff --git a/DubUrl.Testing/Rewriting/Implementation/TeradataRewriterTest.cs b/DubUrl.Testing/Rewriting/Implementation/TeradataRewriterTest.cs index dd9c2793..9e0fb9a4 100644 --- a/DubUrl.Testing/Rewriting/Implementation/TeradataRewriterTest.cs +++ b/DubUrl.Testing/Rewriting/Implementation/TeradataRewriterTest.cs @@ -68,10 +68,16 @@ public void Map_UrlInfoWithUsernamePassword_Authentication() Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey(TeradataRewriter.USERNAME_KEYWORD)); - Assert.That(result[TeradataRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); - Assert.That(result, Does.ContainKey(TeradataRewriter.PASSWORD_KEYWORD)); - Assert.That(result[TeradataRewriter.PASSWORD_KEYWORD], Is.EqualTo("pwd")); - Assert.That(result, Does.ContainKey(TeradataRewriter.SSPI_KEYWORD)); + Assert.Multiple(() => + { + Assert.That(result[TeradataRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); + Assert.That(result, Does.ContainKey(TeradataRewriter.PASSWORD_KEYWORD)); + }); + Assert.Multiple(() => + { + Assert.That(result[TeradataRewriter.PASSWORD_KEYWORD], Is.EqualTo("pwd")); + Assert.That(result, Does.ContainKey(TeradataRewriter.SSPI_KEYWORD)); + }); Assert.That(result[TeradataRewriter.SSPI_KEYWORD], Is.EqualTo(false)); } @@ -83,9 +89,12 @@ public void Map_UrlInfoWithoutUsernamePassword_Authentication() var result = Rewriter.Execute(urlInfo); Assert.That(result, Is.Not.Null); - Assert.That(result[TeradataRewriter.USERNAME_KEYWORD], Is.Null.Or.Empty); - Assert.That(result[TeradataRewriter.PASSWORD_KEYWORD], Is.Null.Or.Empty); - Assert.That(result, Does.ContainKey(TeradataRewriter.SSPI_KEYWORD)); + Assert.Multiple(() => + { + Assert.That(result[TeradataRewriter.USERNAME_KEYWORD], Is.Null.Or.Empty); + Assert.That(result[TeradataRewriter.PASSWORD_KEYWORD], Is.Null.Or.Empty); + Assert.That(result, Does.ContainKey(TeradataRewriter.SSPI_KEYWORD)); + }); Assert.That(result[TeradataRewriter.SSPI_KEYWORD], Is.EqualTo(true)); } } \ No newline at end of file diff --git a/DubUrl.Testing/Rewriting/Implementation/TimescaleRewriterTest.cs b/DubUrl.Testing/Rewriting/Implementation/TimescaleRewriterTest.cs index 10871ef4..7086acef 100644 --- a/DubUrl.Testing/Rewriting/Implementation/TimescaleRewriterTest.cs +++ b/DubUrl.Testing/Rewriting/Implementation/TimescaleRewriterTest.cs @@ -65,8 +65,11 @@ public void Map_UrlInfoWithUsernamePassword_Authentication() Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey(TimescaleRewriter.USERNAME_KEYWORD)); - Assert.That(result[TimescaleRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); - Assert.That(result, Does.ContainKey(TimescaleRewriter.PASSWORD_KEYWORD)); + Assert.Multiple(() => + { + Assert.That(result[TimescaleRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); + Assert.That(result, Does.ContainKey(TimescaleRewriter.PASSWORD_KEYWORD)); + }); Assert.That(result[TimescaleRewriter.PASSWORD_KEYWORD], Is.EqualTo("pwd")); if (Rewriter.IsIntegratedSecurityAllowed) { @@ -108,8 +111,11 @@ public void Map_UrlInfo_Options() Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey("Application Name")); - Assert.That(result["Application Name"], Is.EqualTo("myApp")); - Assert.That(result, Does.ContainKey("Persist Security Info")); + Assert.Multiple(() => + { + Assert.That(result["Application Name"], Is.EqualTo("myApp")); + Assert.That(result, Does.ContainKey("Persist Security Info")); + }); Assert.That(result["Persist Security Info"], Is.True); } } diff --git a/DubUrl.Testing/Rewriting/Implementation/TrinoOdbcRewriterTest.cs b/DubUrl.Testing/Rewriting/Implementation/TrinoOdbcRewriterTest.cs index 361ca413..27974f28 100644 --- a/DubUrl.Testing/Rewriting/Implementation/TrinoOdbcRewriterTest.cs +++ b/DubUrl.Testing/Rewriting/Implementation/TrinoOdbcRewriterTest.cs @@ -80,8 +80,11 @@ public void Map_UrlInfoWithUsernamePassword_Authentication() Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey(OdbcRewriter.USERNAME_KEYWORD)); - Assert.That(result[OdbcRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); - Assert.That(result, Does.ContainKey(OdbcRewriter.PASSWORD_KEYWORD)); + Assert.Multiple(() => + { + Assert.That(result[OdbcRewriter.USERNAME_KEYWORD], Is.EqualTo("user")); + Assert.That(result, Does.ContainKey(OdbcRewriter.PASSWORD_KEYWORD)); + }); Assert.That(result[OdbcRewriter.PASSWORD_KEYWORD], Is.EqualTo("pwd")); } @@ -97,8 +100,11 @@ public void Map_OptionsContainsOptions_OptionsReturned() Assert.That(result, Is.Not.Null); Assert.That(result, Does.ContainKey("ClientTags")); - Assert.That(result["ClientTags"], Is.EqualTo("foo,bar")); - Assert.That(result, Does.ContainKey("ApplicationNamePrefix")); + Assert.Multiple(() => + { + Assert.That(result["ClientTags"], Is.EqualTo("foo,bar")); + Assert.That(result, Does.ContainKey("ApplicationNamePrefix")); + }); Assert.That(result["ApplicationNamePrefix"], Is.EqualTo("qurx")); }