Ejemplo n.º 1
0
 public void Should_add_new_aggregate()
 {
     var agg = new TestAggregateNoParameterLessConstructor(1,Guid.Empty);
     agg.DoSomething();
     _rep.Save(agg,0);
     Assert.AreEqual(1, _eventStore.SavedEvents.Count);
 }
Ejemplo n.º 2
0
 public void Should_set_date()
 {
     var agg = new TestAggregateNoParameterLessConstructor(1, Guid.Empty);
     agg.DoSomething();
     _rep.Save(agg,0);
     Assert.That(_eventStore.SavedEvents.First().Timestamp, Is.InRange(DateTimeOffset.UtcNow.AddSeconds(-1), DateTimeOffset.UtcNow.AddSeconds(1)));
 }
Ejemplo n.º 3
0
 public void Setup()
 {
     _eventStore = new TestEventStore();
     _eventPublisher = new TestEventPublisher();
     var snapshotstore = new NullSnapshotStore();
     _rep = new Repository<TestAggregateNoParameterLessConstructor>(_eventStore, snapshotstore, _eventPublisher);
     _aggregate = new TestAggregateNoParameterLessConstructor(2);
 }