Ejemplo n.º 1
0
        public void TestInit()
        {
            _bdContext       = BdContextBuilder.CreateInMemoryContext(Guid.NewGuid().ToString());
            _aliveRepository = new AliveRepository(_bdContext);
            _deadRepository  = new DeadRepository(_bdContext);

            _personAggregate = new PersonAggregate(_aliveRepository, _deadRepository, _bdContext);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
0
 public ExclusionBaseRepository(string fileName, string deadFileName) : base(fileName)
 {
     deadFileRepository   = new DeadRepository(deadFileName);
     this.DestroyRecords += ExclusionBaseRepository_DestroyRecords;
 }