Ejemplo n.º 1
0
        public async Task SaveChangesAsync_Success_ShouldCallNotifications()
        {
            var expCount = 0;

            var aggregateRoot = new TestAggregateRoot(string.Empty);

            aggregateRoot.AddEvent(new EventInformation(new AfterSaveETO(), true));
            aggregateRoot.AddEvent(new EventInformation(new BeforeSaveETO(), false));

            _Context.Add(aggregateRoot);

            await _Context.SaveChangesAsync();

            aggregateRoot.GetEvents().Should().HaveCount(expCount);
        }