public void When_Loading_From_Event_History()
        {
            var subject = new AggregateStub(Guid.NewGuid());
            var history = new List<EventBaseV1> { new EventStubTypeA(), new EventStubTypeB() };

            subject.LoadFromHistory(history);
            Assert.That(subject.GetUncomittedEvents(), Is.Empty);
            Assert.That(subject.EventTypeAApplied, Is.True);
            Assert.That(subject.EventTypeBApplied, Is.True);
        }
        public void When_Loading_From_Event_History_And_Applying_New_Event()
        {
            var subject = new AggregateStub(Guid.NewGuid());
            var history = new List<EventBaseV1> { new EventStubTypeA(), new EventStubTypeB() };

            subject.LoadFromHistory(history);
            var newEvent = new EventStubTypeC();
            subject.ApplyEventToAggregate(newEvent);

            var uncomittedEvents = subject.GetUncomittedEvents();

            Assert.That(uncomittedEvents, Has.Count.EqualTo(1));
            Assert.That(uncomittedEvents.First(), Is.SameAs(newEvent));
            Assert.That(subject.EventTypeAApplied, Is.True);
            Assert.That(subject.EventTypeBApplied, Is.True);
            Assert.That(subject.EventTypeCApplied, Is.True);
        }