diff --git a/test/HealthChecks.AzureDigitalTwin.Tests/DependencyInjection/AzureDigitalTwinInstanceUnitTests.cs b/test/HealthChecks.AzureDigitalTwin.Tests/DependencyInjection/AzureDigitalTwinInstanceUnitTests.cs index 9bb929bbe8..ac36aa0d3a 100644 --- a/test/HealthChecks.AzureDigitalTwin.Tests/DependencyInjection/AzureDigitalTwinInstanceUnitTests.cs +++ b/test/HealthChecks.AzureDigitalTwin.Tests/DependencyInjection/AzureDigitalTwinInstanceUnitTests.cs @@ -61,7 +61,7 @@ public void fail_when_no_health_check_configuration_provided() var registration = options.Value.Registrations.First(); - Assert.Throws(() => registration.Factory(serviceProvider)); + Should.Throw(() => registration.Factory(serviceProvider)); } [Fact] @@ -117,6 +117,6 @@ public void fail_when_no_health_check_configuration_provided_by_credentials() var registration = options.Value.Registrations.First(); - Assert.Throws(() => registration.Factory(serviceProvider)); + Should.Throw(() => registration.Factory(serviceProvider)); } } diff --git a/test/HealthChecks.AzureDigitalTwin.Tests/DependencyInjection/AzureDigitalTwinModelUnitTests.cs b/test/HealthChecks.AzureDigitalTwin.Tests/DependencyInjection/AzureDigitalTwinModelUnitTests.cs index 6ce3e8b2a0..a6accd9ca6 100644 --- a/test/HealthChecks.AzureDigitalTwin.Tests/DependencyInjection/AzureDigitalTwinModelUnitTests.cs +++ b/test/HealthChecks.AzureDigitalTwin.Tests/DependencyInjection/AzureDigitalTwinModelUnitTests.cs @@ -61,7 +61,7 @@ public void fail_when_no_health_check_configuration_provided() var registration = options.Value.Registrations.First(); - Assert.Throws(() => registration.Factory(serviceProvider)); + Should.Throw(() => registration.Factory(serviceProvider)); } [Fact] @@ -117,6 +117,6 @@ public void fail_when_no_health_check_configuration_provided_by_credentials() var registration = options.Value.Registrations.First(); - Assert.Throws(() => registration.Factory(serviceProvider)); + Should.Throw(() => registration.Factory(serviceProvider)); } } diff --git a/test/HealthChecks.AzureDigitalTwin.Tests/DependencyInjection/AzureDigitalTwinUnitTests.cs b/test/HealthChecks.AzureDigitalTwin.Tests/DependencyInjection/AzureDigitalTwinUnitTests.cs index 352e06ec4f..a405342ba8 100644 --- a/test/HealthChecks.AzureDigitalTwin.Tests/DependencyInjection/AzureDigitalTwinUnitTests.cs +++ b/test/HealthChecks.AzureDigitalTwin.Tests/DependencyInjection/AzureDigitalTwinUnitTests.cs @@ -48,7 +48,7 @@ public void fail_when_no_health_check_configuration_provided() var registration = options.Value.Registrations.First(); - Assert.Throws(() => registration.Factory(serviceProvider)); + Should.Throw(() => registration.Factory(serviceProvider)); } [Fact] @@ -97,6 +97,6 @@ public void fail_when_no_health_check_configuration_provided_by_credentials() var registration = options.Value.Registrations.First(); - Assert.Throws(() => registration.Factory(serviceProvider)); + Should.Throw(() => registration.Factory(serviceProvider)); } } diff --git a/test/HealthChecks.AzureKeyVault.Tests/DependencyInjection/RegistrationTests.cs b/test/HealthChecks.AzureKeyVault.Tests/DependencyInjection/RegistrationTests.cs index 990bd2076c..62e9f2d0e6 100644 --- a/test/HealthChecks.AzureKeyVault.Tests/DependencyInjection/RegistrationTests.cs +++ b/test/HealthChecks.AzureKeyVault.Tests/DependencyInjection/RegistrationTests.cs @@ -48,7 +48,7 @@ public void fail_when_invalid_uri_provided_in_configuration() { var services = new ServiceCollection(); - Assert.Throws(() => + Should.Throw(() => { services.AddHealthChecks() .AddAzureKeyVault(null!, new MockTokenCredentials(), setup => @@ -65,7 +65,7 @@ public void fail_when_invalid_uri_provided_with_service_provider_based_setup_in_ { var services = new ServiceCollection(); - Assert.Throws(() => + Should.Throw(() => { services.AddHealthChecks() .AddAzureKeyVault((Uri)null!, new MockTokenCredentials(), (_, setup) => @@ -82,7 +82,7 @@ public void fail_when_invalid_credential_provided_in_configuration() { var services = new ServiceCollection(); - Assert.Throws(() => + Should.Throw(() => { services.AddHealthChecks() .AddAzureKeyVault(new Uri("http://localhost"), null!, setup => diff --git a/test/HealthChecks.Publisher.ApplicationInsights.Tests/DependencyInjection/RegistrationTests.cs b/test/HealthChecks.Publisher.ApplicationInsights.Tests/DependencyInjection/RegistrationTests.cs index 972aeb61c8..43b6210c0b 100644 --- a/test/HealthChecks.Publisher.ApplicationInsights.Tests/DependencyInjection/RegistrationTests.cs +++ b/test/HealthChecks.Publisher.ApplicationInsights.Tests/DependencyInjection/RegistrationTests.cs @@ -15,7 +15,7 @@ public void add_healthcheck_when_properly_configured_with_instrumentation_key_pa using var serviceProvider = services.BuildServiceProvider(); var publisher = serviceProvider.GetService(); - Assert.NotNull(publisher); + publisher.ShouldNotBeNull(); } [Fact] @@ -29,7 +29,7 @@ public void add_healthcheck_when_properly_configured_with_connection_string_para using var serviceProvider = services.BuildServiceProvider(); var publisher = serviceProvider.GetService(); - Assert.NotNull(publisher); + publisher.ShouldNotBeNull(); } [Fact] @@ -47,6 +47,6 @@ public void add_healthcheck_when_application_insights_is_properly_configured_wit using var serviceProvider = services.BuildServiceProvider(); var publisher = serviceProvider.GetService(); - Assert.NotNull(publisher); + publisher.ShouldNotBeNull(); } } diff --git a/test/HealthChecks.Publisher.CloudWatch.Tests/DependencyInjection/RegistrationTests.cs b/test/HealthChecks.Publisher.CloudWatch.Tests/DependencyInjection/RegistrationTests.cs index c60860dbb3..2b9ef3d75a 100644 --- a/test/HealthChecks.Publisher.CloudWatch.Tests/DependencyInjection/RegistrationTests.cs +++ b/test/HealthChecks.Publisher.CloudWatch.Tests/DependencyInjection/RegistrationTests.cs @@ -13,7 +13,7 @@ public void add_healthcheck_when_properly_configured_with_default_parameter() using var serviceProvider = services.BuildServiceProvider(); var publisher = serviceProvider.GetService(); - Assert.NotNull(publisher); + publisher.ShouldNotBeNull(); } [Fact] @@ -27,7 +27,7 @@ public void add_healthcheck_when_properly_configured_with_custom_service_check_n using var serviceProvider = services.BuildServiceProvider(); var publisher = serviceProvider.GetService(); - Assert.NotNull(publisher); + publisher.ShouldNotBeNull(); } [Fact] @@ -46,7 +46,7 @@ public void add_healthcheck_when_properly_configured_with_default_service_check_ using var serviceProvider = services.BuildServiceProvider(); var publisher = serviceProvider.GetService(); - Assert.NotNull(publisher); + publisher.ShouldNotBeNull(); } [Fact] @@ -66,6 +66,6 @@ public void add_healthcheck_when_properly_configured_with_custom_service_check_n using var serviceProvider = services.BuildServiceProvider(); var publisher = serviceProvider.GetService(); - Assert.NotNull(publisher); + publisher.ShouldNotBeNull(); } } diff --git a/test/HealthChecks.Publisher.Datadog.Tests/DependencyInjection/RegistrationTests.cs b/test/HealthChecks.Publisher.Datadog.Tests/DependencyInjection/RegistrationTests.cs index feff34055c..a8fac7b943 100644 --- a/test/HealthChecks.Publisher.Datadog.Tests/DependencyInjection/RegistrationTests.cs +++ b/test/HealthChecks.Publisher.Datadog.Tests/DependencyInjection/RegistrationTests.cs @@ -13,6 +13,6 @@ public void add_healthcheck_when_properly_configured() using var serviceProvider = services.BuildServiceProvider(); var publisher = serviceProvider.GetService(); - Assert.NotNull(publisher); + publisher.ShouldNotBeNull(); } } diff --git a/test/HealthChecks.Publisher.Prometheus.Tests/DependencyInjection/RegistrationTests.cs b/test/HealthChecks.Publisher.Prometheus.Tests/DependencyInjection/RegistrationTests.cs index 1d9d9534bf..ee11b50a2e 100644 --- a/test/HealthChecks.Publisher.Prometheus.Tests/DependencyInjection/RegistrationTests.cs +++ b/test/HealthChecks.Publisher.Prometheus.Tests/DependencyInjection/RegistrationTests.cs @@ -14,6 +14,6 @@ public void add_healthcheck_when_properly_configured() using var serviceProvider = services.BuildServiceProvider(); var publisher = serviceProvider.GetService(); - Assert.NotNull(publisher); + publisher.ShouldNotBeNull(); } } diff --git a/test/HealthChecks.Publisher.Seq.Tests/DependencyInjection/RegistrationTests.cs b/test/HealthChecks.Publisher.Seq.Tests/DependencyInjection/RegistrationTests.cs index 7a0e900969..a80d0289ca 100644 --- a/test/HealthChecks.Publisher.Seq.Tests/DependencyInjection/RegistrationTests.cs +++ b/test/HealthChecks.Publisher.Seq.Tests/DependencyInjection/RegistrationTests.cs @@ -18,6 +18,6 @@ public void add_healthcheck_when_properly_configured() using var serviceProvider = services.BuildServiceProvider(); var publisher = serviceProvider.GetService(); - Assert.NotNull(publisher); + publisher.ShouldNotBeNull(); } } diff --git a/test/HealthChecks.SqlServer.Tests/DependencyInjection/RegistrationTests.cs b/test/HealthChecks.SqlServer.Tests/DependencyInjection/RegistrationTests.cs index 043d841cb0..4c10b4be68 100644 --- a/test/HealthChecks.SqlServer.Tests/DependencyInjection/RegistrationTests.cs +++ b/test/HealthChecks.SqlServer.Tests/DependencyInjection/RegistrationTests.cs @@ -30,7 +30,7 @@ public void invoke_beforeOpen_when_defined() Action beforeOpen = connection => { invoked = true; - Assert.Equal(connectionstring, connection.ConnectionString); + connection.ConnectionString.ShouldBe(connectionstring); }; services.AddHealthChecks() .AddSqlServer(connectionstring, configure: beforeOpen); @@ -42,7 +42,7 @@ public void invoke_beforeOpen_when_defined() var check = registration.Factory(serviceProvider); Record.ExceptionAsync(() => check.CheckHealthAsync(new HealthCheckContext())).GetAwaiter().GetResult(); - Assert.True(invoked); + invoked.ShouldBeTrue(); } [Fact] diff --git a/test/HealthChecks.System.Tests/DependencyInjection/RegistrationTests.cs b/test/HealthChecks.System.Tests/DependencyInjection/RegistrationTests.cs index e113ef6a97..24224f23aa 100644 --- a/test/HealthChecks.System.Tests/DependencyInjection/RegistrationTests.cs +++ b/test/HealthChecks.System.Tests/DependencyInjection/RegistrationTests.cs @@ -7,7 +7,7 @@ public void throw_exception_when_no_predicate_is_configured() { var services = new ServiceCollection(); - var ex = Assert.Throws(() => + var ex = Should.Throw(() => { services.AddHealthChecks() .AddProcessHealthCheck("dotnet", null!); @@ -21,7 +21,7 @@ public void throw_exception_when_no_process_name_is_configured() { var services = new ServiceCollection(); - var ex = Assert.Throws(() => services.AddHealthChecks().AddProcessHealthCheck("", p => p.Length > 0)); + var ex = Should.Throw(() => services.AddHealthChecks().AddProcessHealthCheck("", p => p.Length > 0)); ex.Message.ShouldBe("Value cannot be null. (Parameter 'processName')"); } diff --git a/test/HealthChecks.System.Tests/Functional/WindowsServiceHealthcheckTests.cs b/test/HealthChecks.System.Tests/Functional/WindowsServiceHealthcheckTests.cs index b3d2b28ebf..587ee068d7 100644 --- a/test/HealthChecks.System.Tests/Functional/WindowsServiceHealthcheckTests.cs +++ b/test/HealthChecks.System.Tests/Functional/WindowsServiceHealthcheckTests.cs @@ -69,7 +69,7 @@ public void throw_exception_when_registering_it_in_a_no_windows_system() }); }); - var exception = Assert.Throws(() => + var exception = Should.Throw(() => { using var server = new TestServer(webhostBuilder); }); diff --git a/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/DockerImageStorageProviderTests.cs b/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/DockerImageStorageProviderTests.cs index 152c938b0a..786c2d61dd 100644 --- a/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/DockerImageStorageProviderTests.cs +++ b/test/HealthChecks.UI.Tests/Functional/DatabaseProviders/DockerImageStorageProviderTests.cs @@ -28,7 +28,7 @@ public void fail_with_invalid_storage_provider_value() }) .UseStartup(); - Assert.Throws(() => hostBuilder.Build()); + Should.Throw(() => hostBuilder.Build()); } [Fact] public void register_sql_server() @@ -67,7 +67,7 @@ public void fail_to_register_sql_server_with_no_connection_string() }) .UseStartup(); - Assert.Throws(() => hostBuilder.Build()); + Should.Throw(() => hostBuilder.Build()); } [Fact] @@ -107,7 +107,7 @@ public void fail_to_register_sqlite_with_no_connection_string() }) .UseStartup(); - Assert.Throws(() => hostBuilder.Build()); + Should.Throw(() => hostBuilder.Build()); } [Fact] @@ -147,7 +147,7 @@ public void fail_to_register_postgresql_with_no_connection_string() }) .UseStartup(); - Assert.Throws(() => hostBuilder.Build()); + Should.Throw(() => hostBuilder.Build()); } [Fact] @@ -223,7 +223,7 @@ public void fail_to_register_mysql_with_no_connection_string() }) .UseStartup(); - Assert.Throws(() => hostBuilder.Build()); + Should.Throw(() => hostBuilder.Build()); } }