Skip to content

Commit

Permalink
fix: unit test argument
Browse files Browse the repository at this point in the history
  • Loading branch information
ericbrunner committed Dec 16, 2024
1 parent 9a1c984 commit 783f7ea
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public async Task Handle_ShouldReturnSuccessStatusMessage_WhenPoolConfigurationI
{
// Arrange
var fullFilePath = GetFullFilePath(poolConfigJsonFilename);
var command = new CreateSnapshot.Command("http://baseaddress", "clientId", "clientSecret", fullFilePath, ClearDatabase: false, BackupDatabase: false);
var command = new CreateSnapshot.Command("http://baseaddress", "clientId", "clientSecret", fullFilePath, ClearDatabase: false, BackupDatabase: false, ClearOnly: false);

A.CallTo(() => _poolConfigurationJsonReader.Read(command.JsonFilePath)).Returns(
new PerformanceTestConfiguration(
Expand Down Expand Up @@ -82,7 +82,7 @@ public async Task Handle_ShouldReturnFailureStatusMessage_WhenPoolConfigurationI
{
// Arrange
var fullFilePath = GetFullFilePath(poolConfigJsonFilename);
var command = new CreateSnapshot.Command("http://baseaddress", "clientId", "clientSecret", fullFilePath, ClearDatabase: false, BackupDatabase: false);
var command = new CreateSnapshot.Command("http://baseaddress", "clientId", "clientSecret", fullFilePath, ClearDatabase: false, BackupDatabase: false, ClearOnly: false);

A.CallTo(() => _poolConfigurationJsonReader.Read(command.JsonFilePath)).Returns(null as PerformanceTestConfiguration);

Expand All @@ -102,7 +102,8 @@ public async Task Handle_ShouldReturnFailureStatusMessage_WhenPoolConfigurationI
public async Task Handle_ShouldReturnFailureStatusMessage_WhenExceptionIsThrown()
{
// Arrange
var command = new CreateSnapshot.Command("http://baseaddress", "clientId", "clientSecret", GetFullFilePath("pool-config.test.json"), ClearDatabase: false, BackupDatabase: false);
var command = new CreateSnapshot.Command("http://baseaddress", "clientId", "clientSecret", GetFullFilePath("pool-config.test.json"), ClearDatabase: false, BackupDatabase: false,
ClearOnly: false);
var expectedException = new Exception("some exception");
A.CallTo(() => _poolConfigurationJsonReader.Read(command.JsonFilePath)).ThrowsAsync(expectedException);

Expand All @@ -123,7 +124,7 @@ public async Task Handle_ShouldReturnFailureStatusMessage_WhenPoolConfigurationF
{
// Arrange
var fullFilePath = GetFullFilePath("not-existing-pool-config.test.json");
var command = new CreateSnapshot.Command("http://baseaddress", "clientId", "clientSecret", fullFilePath, ClearDatabase: false, BackupDatabase: false);
var command = new CreateSnapshot.Command("http://baseaddress", "clientId", "clientSecret", fullFilePath, ClearDatabase: false, BackupDatabase: false, ClearOnly: false);

// Act
var result = await _sut.Handle(command, CancellationToken.None);
Expand Down

0 comments on commit 783f7ea

Please sign in to comment.