示例#1
0
        public void raising_event_should_increate_version()
        {
            Ticket ticket = TicketFactory.ForTest();

            ticket.Sale();
            Assert.Equal(1, ticket.Version);
            Assert.Equal(1, ticket.UncommittedEvents.Count);
            Assert.IsType <TicketSold>(ticket.UncommittedEvents[0]);
            Assert.True(ticket.ExposedStateForTest.HasBeenSold);
        }
示例#2
0
        public void append_should_increase_version()
        {
            Ticket ticket = TicketFactory.ForTest();

            ticket.Append(new TicketSold());

            Assert.True(ticket.IsInitialized);
            Assert.Equal(1, ticket.Version);
            Assert.Empty(ticket.UncommittedEvents);
        }