Esempio n. 1
0
        private TestDomainObject Execute()
        {
            TestDomainObject domainObject = GetSut("22");

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

            var @event = new TestEvent();

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

            sut.RaiseEvent();

            sut.CommitChanges(1);
        }
Esempio n. 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);
        }
Esempio n. 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);
 }
Esempio n. 9
0
 public WhenRaisingEventsWithValidationErrors()
 {
     sut = GetSut("22");
 }
Esempio n. 10
0
 public WhenRaisingEvents()
 {
     sut = Execute();
 }
Esempio n. 11
0
 public WhenCreated()
 {
     sut = GetSut();
 }