public void TestInit() { _bdContext = BdContextBuilder.CreateInMemoryContext(Guid.NewGuid().ToString()); _aliveRepository = new AliveRepository(_bdContext); _deadRepository = new DeadRepository(_bdContext); _personAggregate = new PersonAggregate(_aliveRepository, _deadRepository, _bdContext); }
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); }
public ExclusionBaseRepository(string fileName, string deadFileName) : base(fileName) { deadFileRepository = new DeadRepository(deadFileName); this.DestroyRecords += ExclusionBaseRepository_DestroyRecords; }