CQRS.Tests.CQRS.EventSourcing.EventStoreSessionTests.EventsAreDeletedWhenNotAUnitOfWorkParticipant C# (CSharp) Метод

EventsAreDeletedWhenNotAUnitOfWorkParticipant() приватный Метод

private EventsAreDeletedWhenNotAUnitOfWorkParticipant ( ) : void
Результат void
        public void EventsAreDeletedWhenNotAUnitOfWorkParticipant()
        {
            var bus = new MockServiceBus();
            var store = new MockEventStore();

            using (var session = new EventStoreSession(bus, store, new SingleThreadUseGuard(), DateTimeNowTimeSource.Instance))
            {
                var aggregate1 = new Guid("92EC4FE2-26A8-4274-8674-DC5D95513C83");
                var aggregate2 = new Guid("F08200E4-8790-4ECC-9F06-A3D3BAC9E21C");

                session.Delete(aggregate1);
                session.Delete(aggregate2);

                session.SaveChanges();
                session.SaveChanges();  // Verify that SaveChanges() does not delete the events twice.

                Assert.That(store.DeletedAggregates, Is.EquivalentTo(new[] { aggregate1, aggregate2 }));
            }
        }