diff --git a/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests.csproj b/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests.csproj
index ea796b02..38bdd63e 100644
--- a/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests.csproj
+++ b/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests.csproj
@@ -17,7 +17,8 @@
-
+
+
diff --git a/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/When_custom_container_information_extractor_from_message_registered_via_api.cs b/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/When_custom_container_information_extractor_from_message_registered_via_api.cs
index afbe2587..198b3222 100644
--- a/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/When_custom_container_information_extractor_from_message_registered_via_api.cs
+++ b/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/When_custom_container_information_extractor_from_message_registered_via_api.cs
@@ -25,7 +25,7 @@ public async Task Should_be_used()
.Done(c => c.SagaReceivedMessage)
.Run(runSettings);
- Assert.True(context.ExtractorWasCalled);
+ Assert.That(context.ExtractorWasCalled, Is.True);
}
public class Context : ScenarioContext
diff --git a/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/When_custom_container_information_extractor_from_message_registered_via_di.cs b/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/When_custom_container_information_extractor_from_message_registered_via_di.cs
index 5d4b4979..7e2457b3 100644
--- a/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/When_custom_container_information_extractor_from_message_registered_via_di.cs
+++ b/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/When_custom_container_information_extractor_from_message_registered_via_di.cs
@@ -26,7 +26,7 @@ public async Task Should_be_used()
.Done(c => c.SagaReceivedMessage)
.Run(runSettings);
- Assert.True(context.ExtractorWasCalled);
+ Assert.That(context.ExtractorWasCalled, Is.True);
}
public class Context : ScenarioContext
diff --git a/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/When_custom_partition_key_extractor_from_message_registered_via_api.cs b/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/When_custom_partition_key_extractor_from_message_registered_via_api.cs
index 54f31fcf..cdb89b47 100644
--- a/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/When_custom_partition_key_extractor_from_message_registered_via_api.cs
+++ b/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/When_custom_partition_key_extractor_from_message_registered_via_api.cs
@@ -26,7 +26,7 @@ public async Task Should_be_used()
.Done(c => c.SagaReceivedMessage)
.Run(runSettings);
- Assert.True(context.ExtractorWasCalled);
+ Assert.That(context.ExtractorWasCalled, Is.True);
}
public class Context : ScenarioContext
diff --git a/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/When_custom_partition_key_extractor_from_message_registered_via_di.cs b/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/When_custom_partition_key_extractor_from_message_registered_via_di.cs
index 3fe9afe8..9e143073 100644
--- a/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/When_custom_partition_key_extractor_from_message_registered_via_di.cs
+++ b/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/When_custom_partition_key_extractor_from_message_registered_via_di.cs
@@ -27,7 +27,7 @@ public async Task Should_be_used()
.Done(c => c.SagaReceivedMessage)
.Run(runSettings);
- Assert.True(context.ExtractorWasCalled);
+ Assert.That(context.ExtractorWasCalled, Is.True);
}
public class Context : ScenarioContext
diff --git a/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/When_fluent_extractor_registered_via_api.cs b/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/When_fluent_extractor_registered_via_api.cs
index 9a96cd8e..e25e22e9 100644
--- a/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/When_fluent_extractor_registered_via_api.cs
+++ b/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/When_fluent_extractor_registered_via_api.cs
@@ -23,8 +23,11 @@ public async Task Should_work()
.Done(c => c.SagaReceivedMessage)
.Run(runSettings);
- Assert.True(context.PartitionStateMatched);
- Assert.True(context.ContainerStateMatched);
+ Assert.Multiple(() =>
+ {
+ Assert.That(context.PartitionStateMatched, Is.True);
+ Assert.That(context.ContainerStateMatched, Is.True);
+ });
}
public class Context : ScenarioContext
diff --git a/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/When_using_outbox_synchronized_session_via_container_partial.cs b/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/When_using_outbox_synchronized_session_via_container_partial.cs
index 8e2b8ae4..42338c0a 100644
--- a/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/When_using_outbox_synchronized_session_via_container_partial.cs
+++ b/src/NServiceBus.Persistence.CosmosDB.LogicalOutbox.AcceptanceTests/When_using_outbox_synchronized_session_via_container_partial.cs
@@ -8,8 +8,11 @@ public partial class When_using_outbox_synchronized_session_via_container
partial void AssertPartitionPart(Context scenarioContext)
{
string partitionKeyPath = scenarioContext.PartitionKeyPath;
- Assert.AreEqual(SetupFixture.PartitionPathKey, partitionKeyPath);
- Assert.AreEqual(new PartitionKey(scenarioContext.TestRunId.ToString()), scenarioContext.PartitionKey);
+ Assert.Multiple(() =>
+ {
+ Assert.That(partitionKeyPath, Is.EqualTo(SetupFixture.PartitionPathKey));
+ Assert.That(scenarioContext.PartitionKey, Is.EqualTo(new PartitionKey(scenarioContext.TestRunId.ToString())));
+ });
}
}
}
\ No newline at end of file
diff --git a/src/NServiceBus.Persistence.CosmosDB.NonTransactionalSagas.AcceptanceTests/NServiceBus.Persistence.CosmosDB.NonTransactionalSagas.AcceptanceTests.csproj b/src/NServiceBus.Persistence.CosmosDB.NonTransactionalSagas.AcceptanceTests/NServiceBus.Persistence.CosmosDB.NonTransactionalSagas.AcceptanceTests.csproj
index ee269c02..bc17c7ec 100644
--- a/src/NServiceBus.Persistence.CosmosDB.NonTransactionalSagas.AcceptanceTests/NServiceBus.Persistence.CosmosDB.NonTransactionalSagas.AcceptanceTests.csproj
+++ b/src/NServiceBus.Persistence.CosmosDB.NonTransactionalSagas.AcceptanceTests/NServiceBus.Persistence.CosmosDB.NonTransactionalSagas.AcceptanceTests.csproj
@@ -17,7 +17,8 @@
-
+
+
diff --git a/src/NServiceBus.Persistence.CosmosDB.NonTransactionalSagas.AcceptanceTests/When_custom_container_is_overwritten.cs b/src/NServiceBus.Persistence.CosmosDB.NonTransactionalSagas.AcceptanceTests/When_custom_container_is_overwritten.cs
index aea446c1..2f2b5827 100644
--- a/src/NServiceBus.Persistence.CosmosDB.NonTransactionalSagas.AcceptanceTests/When_custom_container_is_overwritten.cs
+++ b/src/NServiceBus.Persistence.CosmosDB.NonTransactionalSagas.AcceptanceTests/When_custom_container_is_overwritten.cs
@@ -58,8 +58,11 @@ public async Task Should_persist_into_the_provided_container()
var shippingProcessSagaData = await nonDefaultContainer.ReadItemAsync(context.ShippingProcessId,
new PartitionKey(context.ShippingProcessId));
- Assert.AreEqual(HttpStatusCode.OK, orderProcessSagaData.StatusCode);
- Assert.AreEqual(HttpStatusCode.OK, shippingProcessSagaData.StatusCode);
+ Assert.Multiple(() =>
+ {
+ Assert.That(orderProcessSagaData.StatusCode, Is.EqualTo(HttpStatusCode.OK));
+ Assert.That(shippingProcessSagaData.StatusCode, Is.EqualTo(HttpStatusCode.OK));
+ });
}
[TearDown]
diff --git a/src/NServiceBus.Persistence.CosmosDB.NonTransactionalSagas.AcceptanceTests/When_handling_migrated_saga.cs b/src/NServiceBus.Persistence.CosmosDB.NonTransactionalSagas.AcceptanceTests/When_handling_migrated_saga.cs
index b6f89e7a..e0ab0aa6 100644
--- a/src/NServiceBus.Persistence.CosmosDB.NonTransactionalSagas.AcceptanceTests/When_handling_migrated_saga.cs
+++ b/src/NServiceBus.Persistence.CosmosDB.NonTransactionalSagas.AcceptanceTests/When_handling_migrated_saga.cs
@@ -54,7 +54,7 @@ static async Task ImportIntoCosmosDB(Context scenarioContext)
{
var response = await container.CreateItemStreamAsync(stream, new PartitionKey(actualSagaId.ToString()));
- Assert.IsTrue(response.IsSuccessStatusCode, "Successfully imported");
+ Assert.That(response.IsSuccessStatusCode, Is.True, "Successfully imported");
}
}
diff --git a/src/NServiceBus.Persistence.CosmosDB.PersistenceTests/NServiceBus.Persistence.CosmosDB.PersistenceTests.csproj b/src/NServiceBus.Persistence.CosmosDB.PersistenceTests/NServiceBus.Persistence.CosmosDB.PersistenceTests.csproj
index 3f45af25..683871e1 100644
--- a/src/NServiceBus.Persistence.CosmosDB.PersistenceTests/NServiceBus.Persistence.CosmosDB.PersistenceTests.csproj
+++ b/src/NServiceBus.Persistence.CosmosDB.PersistenceTests/NServiceBus.Persistence.CosmosDB.PersistenceTests.csproj
@@ -17,6 +17,7 @@
+
diff --git a/src/NServiceBus.Persistence.CosmosDB.PersistenceTests/SetupFixture.cs b/src/NServiceBus.Persistence.CosmosDB.PersistenceTests/SetupFixture.cs
index 0e3e5db0..7f234cfa 100644
--- a/src/NServiceBus.Persistence.CosmosDB.PersistenceTests/SetupFixture.cs
+++ b/src/NServiceBus.Persistence.CosmosDB.PersistenceTests/SetupFixture.cs
@@ -45,9 +45,10 @@ public async Task OneTimeSetUp()
}
[OneTimeTearDown]
- public Task OneTimeTearDown()
+ public async Task OneTimeTearDown()
{
- return Container.DeleteContainerStreamAsync();
+ await Container.DeleteContainerStreamAsync();
+ CosmosDbClient.Dispose();
}
static string GetEnvironmentVariable(string variable, string fallbackEmulatorConnectionString)
diff --git a/src/NServiceBus.Persistence.CosmosDB.PessimisticLock.AcceptanceTests/NServiceBus.Persistence.CosmosDB.PessimisticLock.AcceptanceTests.csproj b/src/NServiceBus.Persistence.CosmosDB.PessimisticLock.AcceptanceTests/NServiceBus.Persistence.CosmosDB.PessimisticLock.AcceptanceTests.csproj
index 9ea7c299..5c1270bd 100644
--- a/src/NServiceBus.Persistence.CosmosDB.PessimisticLock.AcceptanceTests/NServiceBus.Persistence.CosmosDB.PessimisticLock.AcceptanceTests.csproj
+++ b/src/NServiceBus.Persistence.CosmosDB.PessimisticLock.AcceptanceTests/NServiceBus.Persistence.CosmosDB.PessimisticLock.AcceptanceTests.csproj
@@ -17,7 +17,8 @@
-
+
+
diff --git a/src/NServiceBus.Persistence.CosmosDB.PessimisticLock.AcceptanceTests/When_storing_migrated_saga_with_high_contention.cs b/src/NServiceBus.Persistence.CosmosDB.PessimisticLock.AcceptanceTests/When_storing_migrated_saga_with_high_contention.cs
index e1657437..e2d7e523 100644
--- a/src/NServiceBus.Persistence.CosmosDB.PessimisticLock.AcceptanceTests/When_storing_migrated_saga_with_high_contention.cs
+++ b/src/NServiceBus.Persistence.CosmosDB.PessimisticLock.AcceptanceTests/When_storing_migrated_saga_with_high_contention.cs
@@ -38,8 +38,11 @@ await Task.WhenAll(Enumerable.Range(0, scenarioContext.ConcurrentMessageCount).S
.Done(s => s.SagaCompleted)
.Run();
- Assert.IsTrue(context.ConcurrentMessagesSent);
- Assert.AreEqual(0, context.RetryCount);
+ Assert.Multiple(() =>
+ {
+ Assert.That(context.ConcurrentMessagesSent, Is.True);
+ Assert.That(context.RetryCount, Is.EqualTo(0));
+ });
}
static string MigrationDocument = @"{{
@@ -67,7 +70,7 @@ static async Task ImportIntoCosmosDB(HighContentionScenario scenarioContext)
{
var response = await container.CreateItemStreamAsync(stream, new PartitionKey(actualSagaId.ToString()));
- Assert.IsTrue(response.IsSuccessStatusCode, "Successfully imported");
+ Assert.That(response.IsSuccessStatusCode, Is.True, "Successfully imported");
}
}
diff --git a/src/NServiceBus.Persistence.CosmosDB.PessimisticLock.AcceptanceTests/When_storing_saga_with_high_contention.cs b/src/NServiceBus.Persistence.CosmosDB.PessimisticLock.AcceptanceTests/When_storing_saga_with_high_contention.cs
index 17cc9744..39429009 100644
--- a/src/NServiceBus.Persistence.CosmosDB.PessimisticLock.AcceptanceTests/When_storing_saga_with_high_contention.cs
+++ b/src/NServiceBus.Persistence.CosmosDB.PessimisticLock.AcceptanceTests/When_storing_saga_with_high_contention.cs
@@ -22,8 +22,11 @@ public async Task Should_succeed_without_retries()
.Done(s => s.SagaCompleted)
.Run();
- Assert.IsTrue(scenario.ConcurrentMessagesSent);
- Assert.AreEqual(0, scenario.RetryCount);
+ Assert.Multiple(() =>
+ {
+ Assert.That(scenario.ConcurrentMessagesSent, Is.True);
+ Assert.That(scenario.RetryCount, Is.EqualTo(0));
+ });
}
public class HighContentionScenario : ScenarioContext
diff --git a/src/NServiceBus.Persistence.CosmosDB.PhysicalOutbox.AcceptanceTests/NServiceBus.Persistence.CosmosDB.PhysicalOutbox.AcceptanceTests.csproj b/src/NServiceBus.Persistence.CosmosDB.PhysicalOutbox.AcceptanceTests/NServiceBus.Persistence.CosmosDB.PhysicalOutbox.AcceptanceTests.csproj
index ea796b02..38bdd63e 100644
--- a/src/NServiceBus.Persistence.CosmosDB.PhysicalOutbox.AcceptanceTests/NServiceBus.Persistence.CosmosDB.PhysicalOutbox.AcceptanceTests.csproj
+++ b/src/NServiceBus.Persistence.CosmosDB.PhysicalOutbox.AcceptanceTests/NServiceBus.Persistence.CosmosDB.PhysicalOutbox.AcceptanceTests.csproj
@@ -17,7 +17,8 @@
-
+
+
diff --git a/src/NServiceBus.Persistence.CosmosDB.PhysicalOutbox.AcceptanceTests/When_custom_container_information_extractor_from_headers_registered_via_api.cs b/src/NServiceBus.Persistence.CosmosDB.PhysicalOutbox.AcceptanceTests/When_custom_container_information_extractor_from_headers_registered_via_api.cs
index 7880032a..43b61bb0 100644
--- a/src/NServiceBus.Persistence.CosmosDB.PhysicalOutbox.AcceptanceTests/When_custom_container_information_extractor_from_headers_registered_via_api.cs
+++ b/src/NServiceBus.Persistence.CosmosDB.PhysicalOutbox.AcceptanceTests/When_custom_container_information_extractor_from_headers_registered_via_api.cs
@@ -25,7 +25,7 @@ public async Task Should_be_used()
.Done(c => c.SagaReceivedMessage)
.Run(runSettings);
- Assert.True(context.ExtractorWasCalled);
+ Assert.That(context.ExtractorWasCalled, Is.True);
}
public class Context : ScenarioContext
diff --git a/src/NServiceBus.Persistence.CosmosDB.PhysicalOutbox.AcceptanceTests/When_custom_container_information_extractor_from_headers_registered_via_di.cs b/src/NServiceBus.Persistence.CosmosDB.PhysicalOutbox.AcceptanceTests/When_custom_container_information_extractor_from_headers_registered_via_di.cs
index d61db4b7..b9faad9b 100644
--- a/src/NServiceBus.Persistence.CosmosDB.PhysicalOutbox.AcceptanceTests/When_custom_container_information_extractor_from_headers_registered_via_di.cs
+++ b/src/NServiceBus.Persistence.CosmosDB.PhysicalOutbox.AcceptanceTests/When_custom_container_information_extractor_from_headers_registered_via_di.cs
@@ -26,7 +26,7 @@ public async Task Should_be_used()
.Done(c => c.SagaReceivedMessage)
.Run(runSettings);
- Assert.True(context.ExtractorWasCalled);
+ Assert.That(context.ExtractorWasCalled, Is.True);
}
public class Context : ScenarioContext
diff --git a/src/NServiceBus.Persistence.CosmosDB.PhysicalOutbox.AcceptanceTests/When_using_outbox_synchronized_session_via_container_partial.cs b/src/NServiceBus.Persistence.CosmosDB.PhysicalOutbox.AcceptanceTests/When_using_outbox_synchronized_session_via_container_partial.cs
index 8e2b8ae4..2b9531f2 100644
--- a/src/NServiceBus.Persistence.CosmosDB.PhysicalOutbox.AcceptanceTests/When_using_outbox_synchronized_session_via_container_partial.cs
+++ b/src/NServiceBus.Persistence.CosmosDB.PhysicalOutbox.AcceptanceTests/When_using_outbox_synchronized_session_via_container_partial.cs
@@ -8,8 +8,8 @@ public partial class When_using_outbox_synchronized_session_via_container
partial void AssertPartitionPart(Context scenarioContext)
{
string partitionKeyPath = scenarioContext.PartitionKeyPath;
- Assert.AreEqual(SetupFixture.PartitionPathKey, partitionKeyPath);
- Assert.AreEqual(new PartitionKey(scenarioContext.TestRunId.ToString()), scenarioContext.PartitionKey);
+ Assert.That(partitionKeyPath, Is.EqualTo(SetupFixture.PartitionPathKey));
+ Assert.That(scenarioContext.PartitionKey, Is.EqualTo(new PartitionKey(scenarioContext.TestRunId.ToString())));
}
}
}
\ No newline at end of file
diff --git a/src/NServiceBus.Persistence.CosmosDB.Tests/NServiceBus.Persistence.CosmosDB.Tests.csproj b/src/NServiceBus.Persistence.CosmosDB.Tests/NServiceBus.Persistence.CosmosDB.Tests.csproj
index 0f1d4974..9a85254b 100644
--- a/src/NServiceBus.Persistence.CosmosDB.Tests/NServiceBus.Persistence.CosmosDB.Tests.csproj
+++ b/src/NServiceBus.Persistence.CosmosDB.Tests/NServiceBus.Persistence.CosmosDB.Tests.csproj
@@ -13,7 +13,8 @@
-
+
+
diff --git a/src/NServiceBus.Persistence.CosmosDB.Tests/Outbox/LogicalOutboxBehaviorTests.cs b/src/NServiceBus.Persistence.CosmosDB.Tests/Outbox/LogicalOutboxBehaviorTests.cs
index c3b6466e..3580fd54 100644
--- a/src/NServiceBus.Persistence.CosmosDB.Tests/Outbox/LogicalOutboxBehaviorTests.cs
+++ b/src/NServiceBus.Persistence.CosmosDB.Tests/Outbox/LogicalOutboxBehaviorTests.cs
@@ -63,8 +63,11 @@ public async Task Should_clear_added_pending_operations_and_restore_ones_from_ou
await behavior.Invoke(testableContext, c => Task.CompletedTask);
- Assert.IsTrue(pendingTransportOperations.HasOperations, "Should have exactly one operation added found on the outbox record");
- Assert.AreEqual("42", pendingTransportOperations.Operations.ElementAt(0).Message.MessageId, "Should have exactly one operation added found on the outbox record");
+ Assert.Multiple(() =>
+ {
+ Assert.That(pendingTransportOperations.HasOperations, Is.True, "Should have exactly one operation added found on the outbox record");
+ Assert.That(pendingTransportOperations.Operations.ElementAt(0).Message.MessageId, Is.EqualTo("42"), "Should have exactly one operation added found on the outbox record");
+ });
}
}
diff --git a/src/NServiceBus.Persistence.CosmosDB.Tests/Saga/PessimisticLockingConfigurationTests.cs b/src/NServiceBus.Persistence.CosmosDB.Tests/Saga/PessimisticLockingConfigurationTests.cs
index c6b04642..60a1a1af 100644
--- a/src/NServiceBus.Persistence.CosmosDB.Tests/Saga/PessimisticLockingConfigurationTests.cs
+++ b/src/NServiceBus.Persistence.CosmosDB.Tests/Saga/PessimisticLockingConfigurationTests.cs
@@ -11,11 +11,14 @@ public void Should_have_default_values()
{
var configuration = new PessimisticLockingConfiguration();
- Assert.That(configuration.LeaseLockTime, Is.EqualTo(TimeSpan.FromMinutes(1)));
- Assert.That(configuration.LeaseLockAcquisitionTimeout, Is.EqualTo(TimeSpan.FromMinutes(1)));
- Assert.That(configuration.LeaseLockAcquisitionMinimumRefreshDelay, Is.EqualTo(TimeSpan.FromMilliseconds(500)));
- Assert.That(configuration.LeaseLockAcquisitionMaximumRefreshDelay, Is.EqualTo(TimeSpan.FromMilliseconds(1000)));
- Assert.That(configuration.PessimisticLockingEnabled, Is.False);
+ Assert.Multiple(() =>
+ {
+ Assert.That(configuration.LeaseLockTime, Is.EqualTo(TimeSpan.FromMinutes(1)));
+ Assert.That(configuration.LeaseLockAcquisitionTimeout, Is.EqualTo(TimeSpan.FromMinutes(1)));
+ Assert.That(configuration.LeaseLockAcquisitionMinimumRefreshDelay, Is.EqualTo(TimeSpan.FromMilliseconds(500)));
+ Assert.That(configuration.LeaseLockAcquisitionMaximumRefreshDelay, Is.EqualTo(TimeSpan.FromMilliseconds(1000)));
+ Assert.That(configuration.PessimisticLockingEnabled, Is.False);
+ });
}
[Test]
@@ -35,7 +38,7 @@ public void Should_set_lease_lock_time([Random(1, 10, 5, Distinct = true)] doubl
configuration.SetLeaseLockTime(fromMinutes);
- Assert.AreEqual(fromMinutes, configuration.LeaseLockTime);
+ Assert.That(configuration.LeaseLockTime, Is.EqualTo(fromMinutes));
}
[Test]
@@ -55,7 +58,7 @@ public void Should_set_lease_lock_acquisition_timeout([Random(1, 10, 5, Distinct
configuration.SetLeaseLockTime(fromMinutes);
- Assert.AreEqual(fromMinutes, configuration.LeaseLockTime);
+ Assert.That(configuration.LeaseLockTime, Is.EqualTo(fromMinutes));
}
[Test]
@@ -95,7 +98,7 @@ public void Should_set_minimum_refresh_delay_when_below_default_maximum_refresh_
configuration.SetLeaseLockAcquisitionMinimumRefreshDelay(fromMilliseconds);
configuration.ValidateRefreshDelays();
- Assert.AreEqual(fromMilliseconds, configuration.LeaseLockAcquisitionMinimumRefreshDelay);
+ Assert.That(configuration.LeaseLockAcquisitionMinimumRefreshDelay, Is.EqualTo(fromMilliseconds));
}
[Test]
@@ -109,7 +112,7 @@ public void Should_set_minimum_refresh_delay_when_below_maximum_refresh_delay([R
configuration.SetLeaseLockAcquisitionMinimumRefreshDelay(fromMilliseconds);
configuration.ValidateRefreshDelays();
- Assert.AreEqual(fromMilliseconds, configuration.LeaseLockAcquisitionMinimumRefreshDelay);
+ Assert.That(configuration.LeaseLockAcquisitionMinimumRefreshDelay, Is.EqualTo(fromMilliseconds));
}
[Test]
@@ -149,7 +152,7 @@ public void Should_set_maximum_refresh_delay_when_above_default_minimum_refresh_
configuration.SetLeaseLockAcquisitionMaximumRefreshDelay(fromMilliseconds);
configuration.ValidateRefreshDelays();
- Assert.AreEqual(fromMilliseconds, configuration.LeaseLockAcquisitionMaximumRefreshDelay);
+ Assert.That(configuration.LeaseLockAcquisitionMaximumRefreshDelay, Is.EqualTo(fromMilliseconds));
}
[Test]
@@ -163,7 +166,7 @@ public void Should_set_maximum_refresh_delay_when_above_minimum_refresh_delay([R
configuration.SetLeaseLockAcquisitionMaximumRefreshDelay(fromMilliseconds);
configuration.ValidateRefreshDelays();
- Assert.AreEqual(fromMilliseconds, configuration.LeaseLockAcquisitionMaximumRefreshDelay);
+ Assert.That(configuration.LeaseLockAcquisitionMaximumRefreshDelay, Is.EqualTo(fromMilliseconds));
}
}
}
\ No newline at end of file
diff --git a/src/NServiceBus.Persistence.CosmosDB.Tests/Saga/SagaIdGeneratorTests.cs b/src/NServiceBus.Persistence.CosmosDB.Tests/Saga/SagaIdGeneratorTests.cs
index 17b1def3..042e1232 100644
--- a/src/NServiceBus.Persistence.CosmosDB.Tests/Saga/SagaIdGeneratorTests.cs
+++ b/src/NServiceBus.Persistence.CosmosDB.Tests/Saga/SagaIdGeneratorTests.cs
@@ -12,11 +12,11 @@ public class SagaIdGeneratorTests
{
[Test]
public void Should_return_the_same_guid_regardless_of_the_tfm() =>
- Assert.AreEqual(new Guid("c718ea15-a555-f79f-fa37-62477f3b07ca"), CosmosSagaIdGenerator.Generate("SagaEntityTypeFullName", "CorrelationPropertyName", "SomeValue"));
+ Assert.That(CosmosSagaIdGenerator.Generate("SagaEntityTypeFullName", "CorrelationPropertyName", "SomeValue"), Is.EqualTo(new Guid("c718ea15-a555-f79f-fa37-62477f3b07ca")));
- [TestCaseSource("RandomInput")]
+ [TestCaseSource(nameof(RandomInput))]
public void Should_return_the_same_guid_as_previous(string fullname, string propertyName, string propertyValue) =>
- Assert.AreEqual(PreviousCosmosSagaIdGenerator.Generate(fullname, propertyName, propertyValue), CosmosSagaIdGenerator.Generate(fullname, propertyName, propertyValue));
+ Assert.That(CosmosSagaIdGenerator.Generate(fullname, propertyName, propertyValue), Is.EqualTo(PreviousCosmosSagaIdGenerator.Generate(fullname, propertyName, propertyValue)));
public static IEnumerable