コード例 #1
0
 public async Task AppendAsync_should_throw_when_input_null()
 {
     var dbContext  = NSubstitute.Substitute.For <ISagaDbContext>();
     var serializer = NSubstitute.Substitute.For <IPersistenceSerializer>();
     var sut        = new SqlOutboxRepository(dbContext, serializer, SqlOutboxRepositoryOptions.Default);
     await Assert.ThrowsAsync <ArgumentNullException>(async() => await sut.AppendAsync(null));
 }
コード例 #2
0
        public async Task ReleaseAsync_should_throw_if_message_null()
        {
            var dbContext  = NSubstitute.Substitute.For <ISagaDbContext>();
            var serializer = NSubstitute.Substitute.For <IPersistenceSerializer>();
            var sut        = new SqlOutboxRepository(dbContext, serializer, SqlOutboxRepositoryOptions.Default);

            await Assert.ThrowsAsync <ArgumentNullException>(async() => await sut.ReleaseAsync(null, Guid.Empty));
        }
コード例 #3
0
        private SqlOutboxRepository CreateSut(ISagaDbContext db)
        {
            var sut = new SqlOutboxRepository(db, new JsonSerializer(), SqlOutboxRepositoryOptions.Default);

            return(sut);
        }
コード例 #4
0
        private SqlOutboxRepository CreateSut()
        {
            var sut = new SqlOutboxRepository(_fixture.DbContext, new JsonSerializer(), SqlOutboxRepositoryOptions.Default);

            return(sut);
        }