Skip to content

Commit

Permalink
test: Fix nullability warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
VMelnalksnis committed Jan 14, 2024
1 parent cb20944 commit 330ae67
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,11 @@ private async Task ShouldBeDeletedWithClient<TEntity>(Guid id, IGnomeshadeClient
var deletedEntity = await Fixture.GetEntityRepository(scope).FindByIdAsync<TEntity>(id);
var userId = (await client.GetMyCounterpartyAsync()).CreatedByUserId;

using (new AssertionScope())
{
deletedEntity.DeletedAt.Should().NotBeNull();
deletedEntity.DeletedByUserId.Should().Be(userId);
}
using var assertionScope = new AssertionScope();

deletedEntity.Should().NotBeNull();
deletedEntity?.DeletedAt.Should().NotBeNull();
deletedEntity?.DeletedByUserId.Should().Be(userId);
}

private Task ShouldBeNotFoundForOthers(Func<IGnomeshadeClient, Task> func, bool inverted = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public EntityRepository(DbConnection dbConnection)
_dbConnection = dbConnection;
}

internal async Task<IEntity> FindByIdAsync<TEntity>(Guid id)
internal async Task<IEntity?> FindByIdAsync<TEntity>(Guid id)
where TEntity : Entity
{
var tableName = _tableNames[typeof(TEntity)];
Expand Down

0 comments on commit 330ae67

Please sign in to comment.