public void DomainEventsAreClearedTest()
        {
            var dut          = new TestableEntityBase();
            var domainEvent1 = new Mock <INotification>();

            dut.AddPreSaveDomainEvent(domainEvent1.Object);
            var domainEvent2 = new Mock <INotification>();

            dut.AddPreSaveDomainEvent(domainEvent2.Object);

            dut.ClearPreSaveDomainEvents();

            Assert.AreEqual(0, dut.PreSaveDomainEvents.Count);
        }
        public void DomainEventIsAddedToListTest()
        {
            var dut         = new TestableEntityBase();
            var domainEvent = new Mock <INotification>();

            dut.AddPreSaveDomainEvent(domainEvent.Object);

            Assert.IsTrue(dut.PreSaveDomainEvents.Contains(domainEvent.Object));
        }
        public void DomainEventIsRemovedFromListTest()
        {
            var dut         = new TestableEntityBase();
            var domainEvent = new Mock <INotification>();

            dut.AddPreSaveDomainEvent(domainEvent.Object);
            dut.RemovePreSaveDomainEvent(domainEvent.Object);

            Assert.IsFalse(dut.PreSaveDomainEvents.Contains(domainEvent.Object));
        }