public async Task AppendAsync_should_throw_when_input_null() { var dbContext = NSubstitute.Substitute.For <ISagaDbContext>(); var serializer = NSubstitute.Substitute.For <ISerializer>(); var sut = new CosmosSqlOutboxRepository(dbContext, serializer, CosmosSqlOutboxRepositoryOptions.Default); await Assert.ThrowsAsync <ArgumentNullException>(async() => await sut.AppendAsync(null)); }
public async Task ReleaseAsync_should_throw_if_message_null() { var dbContext = NSubstitute.Substitute.For <ISagaDbContext>(); var serializer = NSubstitute.Substitute.For <ISerializer>(); var sut = new CosmosSqlOutboxRepository(dbContext, serializer, CosmosSqlOutboxRepositoryOptions.Default); await Assert.ThrowsAsync <ArgumentNullException>(async() => await sut.ReleaseAsync(null, Guid.Empty)); }
private CosmosSqlOutboxRepository CreateSut(ISagaDbContext sagaDbContext) { var sut = new CosmosSqlOutboxRepository(sagaDbContext, new JsonSerializer(), CosmosSqlOutboxRepositoryOptions.Default); return(sut); }