Пример #1
0
        public void TestTransaction()
        {
            var bdContext       = BdContextBuilder.CreateSqliteContext(Guid.NewGuid().ToString());
            var aliveRepository = new AliveRepository(bdContext);
            var deadRepository  = new DeadRepository(bdContext);

            var personAggregate = new PersonAggregate(aliveRepository, deadRepository, bdContext);

            personAggregate.Kill(12345);

            bdContext.Alive.Count(a => a.Document == 12345).Should().Be(0);
            bdContext.Dead.Count().Should().Be(1);
        }
Пример #2
0
        public void TransactionWithMemoryDb()
        {
            Action kill = () => _personAggregate.Kill(54321);

            kill.Should().Throw <InvalidOperationException>();
        }