Skip to content

Commit

Permalink
addded more code coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Neil South <[email protected]>
  • Loading branch information
neildsouth committed May 23, 2024
1 parent 8b09c91 commit e57c58b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/WorkflowManager/Common/Services/PayloadService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,5 @@ public Task<bool> UpdateAsyncWorkflowIds(Payload payload)

return _payloadRepository.UpdateAsyncWorkflowIds(payload);
}

public Task<bool> UpdateAsync(Payload payload)
{
ArgumentNullException.ThrowIfNull(payload, nameof(payload));

return _payloadRepository.UpdateAsyncWorkflowIds(payload);
}
}
}
11 changes: 11 additions & 0 deletions tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -488,5 +488,16 @@ public async Task PayloadServiceCreate_Should_Call_GetExpiry()
Assert.Equal(99, (int)daysdiff);
}


[Fact]
public async Task UpdateAsync_NullPayload_ThrowsArgumentNullException()
{
// Arrange
Payload payload = null;

Check warning on line 496 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / task-manager-integration-tests

Converting null literal or possible null value to non-nullable type.

Check warning on line 496 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / task-manager-integration-tests

Converting null literal or possible null value to non-nullable type.

Check warning on line 496 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / unit-tests-and-codecov

Converting null literal or possible null value to non-nullable type.

Check warning on line 496 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / unit-tests-and-codecov

Converting null literal or possible null value to non-nullable type.

Check warning on line 496 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / unit-tests-and-codecov

Converting null literal or possible null value to non-nullable type.

Check warning on line 496 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / docs

Converting null literal or possible null value to non-nullable type.

Check warning on line 496 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / docs

Converting null literal or possible null value to non-nullable type.

Check warning on line 496 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / scan

Converting null literal or possible null value to non-nullable type.

Check warning on line 496 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / scan

Converting null literal or possible null value to non-nullable type.

Check warning on line 496 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / workflow-executor-integration-tests

Converting null literal or possible null value to non-nullable type.

Check warning on line 496 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / workflow-executor-integration-tests

Converting null literal or possible null value to non-nullable type.

Check warning on line 496 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / analyze

Converting null literal or possible null value to non-nullable type.

Check warning on line 496 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / analyze

Converting null literal or possible null value to non-nullable type.

Check warning on line 496 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / docs

Converting null literal or possible null value to non-nullable type.

Check warning on line 496 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / docs

Converting null literal or possible null value to non-nullable type.

// Act & Assert
await Assert.ThrowsAsync<ArgumentNullException>(() => PayloadService.UpdateAsyncWorkflowIds(payload));

Check warning on line 499 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / task-manager-integration-tests

Possible null reference argument for parameter 'payload' in 'Task<bool> IPayloadService.UpdateAsyncWorkflowIds(Payload payload)'.

Check warning on line 499 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / task-manager-integration-tests

Possible null reference argument for parameter 'payload' in 'Task<bool> IPayloadService.UpdateAsyncWorkflowIds(Payload payload)'.

Check warning on line 499 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / unit-tests-and-codecov

Possible null reference argument for parameter 'payload' in 'Task<bool> IPayloadService.UpdateAsyncWorkflowIds(Payload payload)'.

Check warning on line 499 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / unit-tests-and-codecov

Possible null reference argument for parameter 'payload' in 'Task<bool> IPayloadService.UpdateAsyncWorkflowIds(Payload payload)'.

Check warning on line 499 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / unit-tests-and-codecov

Possible null reference argument for parameter 'payload' in 'Task<bool> IPayloadService.UpdateAsyncWorkflowIds(Payload payload)'.

Check warning on line 499 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / docs

Possible null reference argument for parameter 'payload' in 'Task<bool> IPayloadService.UpdateAsyncWorkflowIds(Payload payload)'.

Check warning on line 499 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / docs

Possible null reference argument for parameter 'payload' in 'Task<bool> IPayloadService.UpdateAsyncWorkflowIds(Payload payload)'.

Check warning on line 499 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / scan

Possible null reference argument for parameter 'payload' in 'Task<bool> IPayloadService.UpdateAsyncWorkflowIds(Payload payload)'.

Check warning on line 499 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / scan

Possible null reference argument for parameter 'payload' in 'Task<bool> IPayloadService.UpdateAsyncWorkflowIds(Payload payload)'.

Check warning on line 499 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / workflow-executor-integration-tests

Possible null reference argument for parameter 'payload' in 'Task<bool> IPayloadService.UpdateAsyncWorkflowIds(Payload payload)'.

Check warning on line 499 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / workflow-executor-integration-tests

Possible null reference argument for parameter 'payload' in 'Task<bool> IPayloadService.UpdateAsyncWorkflowIds(Payload payload)'.

Check warning on line 499 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / analyze

Possible null reference argument for parameter 'payload' in 'Task<bool> IPayloadService.UpdateAsyncWorkflowIds(Payload payload)'.

Check warning on line 499 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / analyze

Possible null reference argument for parameter 'payload' in 'Task<bool> IPayloadService.UpdateAsyncWorkflowIds(Payload payload)'.

Check warning on line 499 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / docs

Possible null reference argument for parameter 'payload' in 'Task<bool> IPayloadService.UpdateAsyncWorkflowIds(Payload payload)'.

Check warning on line 499 in tests/UnitTests/Common.Tests/Services/PayloadServiceTests.cs

View workflow job for this annotation

GitHub Actions / docs

Possible null reference argument for parameter 'payload' in 'Task<bool> IPayloadService.UpdateAsyncWorkflowIds(Payload payload)'.
}

}
}

0 comments on commit e57c58b

Please sign in to comment.