private TestDomainObject Execute()
        {
            TestDomainObject domainObject = GetSut("22");

            domainObject.RaiseEvent();
            return(domainObject);
        }
Exemple #2
0
        public WhenApplyingEvents()
        {
            sut = GetSut("11");

            var @event = new TestEvent();

            sut.ApplyEvent(@event);
        }
Exemple #3
0
        public WhenComittingEvents()
        {
            sut = GetSut("222");

            sut.RaiseEvent();

            sut.CommitChanges(1);
        }
Exemple #4
0
        protected TestDomainObject GetSut(string id)
        {
            var bo        = new TestDomainObject(id);
            var activator = new ActivatorDomainObjectActivator();

            bo.ApplyConfig(new EventSourceConfiguration(), new EventsourceDIContext(activator, activator), new StateEventMapping(), null);

            return(bo);
        }
        public void ItDoesntDoAnythingWithoutChanges()
        {
            TestDomainObject sut = GetSut("aa");

            sut.RevertChanges();

            Assert.Equal(0, sut.Version);
            Assert.Equal(0, sut.OriginVersion);
        }
        public void WhenRevertingEvents()
        {
            TestDomainObject sut = GetSut("aa");

            sut.RaiseEvent();
            sut.RevertChanges();

            Assert.Equal(0, sut.Version);
            Assert.Equal(0, sut.OriginVersion);
        }
Exemple #7
0
        public WhenApplyingEvents()
        {
            sut = GetSut("11");

            var @event = new TestEvent();
            var events = new List <IEvent>
            {
                @event
            };

            sut.ApplyEvents(events, null);
        }
 public WhenCommitingNoEvents()
 {
     sut = GetSut("22");
     sut.CommitChanges(2);
 }
Exemple #9
0
 public WhenRaisingEventsWithValidationErrors()
 {
     sut = GetSut("22");
 }
 public WhenRaisingEvents()
 {
     sut = Execute();
 }
Exemple #11
0
 public WhenCreated()
 {
     sut = GetSut();
 }