Skip to content

Commit

Permalink
Remove redundant warning disable pragmas
Browse files Browse the repository at this point in the history
  • Loading branch information
sdepouw committed Mar 8, 2024
1 parent 26d95da commit 776cada
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,7 @@ public async Task ReturnsExceptionMessageGivenInvalidEmail()
[Fact]
public async Task ReturnsExceptionMessageGivenInvalidInviteCode()
{

#pragma warning disable CS8620 // Argument cannot be used for parameter due to differences in the nullability of reference types.
#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type.
_ = _invitationRepository.FirstOrDefaultAsync(Arg.Any<InvitationByInviteCodeSpec>(), CancellationToken.None).Returns((Invitation)null);
#pragma warning restore CS8600 // Converting null literal or possible null value to non-nullable type.
#pragma warning restore CS8620 // Argument cannot be used for parameter due to differences in the nullability of reference types.
_ = _invitationRepository.FirstOrDefaultAsync(Arg.Any<InvitationByInviteCodeSpec>(), CancellationToken.None).Returns((Invitation)null!);

Check warning

Code scanning / CodeQL

Useless upcast Warning test

There is no need to upcast from
null
to
Invitation
- the conversion can be done implicitly.

var result = await _newMemberService.VerifyValidEmailAndInviteCodeAsync(_email, _inviteCode);

Expand Down

0 comments on commit 776cada

Please sign in to comment.