예제 #1
0
        public void FinishLoan_BookLoan_BookLoanInReturnedState()
        {
            var bookLoan = new BookLoan(1, 1);

            bookLoan.FinishLoan();

            bookLoan.IsPending.Should().BeFalse();
            bookLoan.IsBorrowed.Should().BeFalse();
            bookLoan.IsReturned.Should().BeTrue();
        }
예제 #2
0
        public void FinishLoan_BookLoan_AddBookLoanFinishedEvent()
        {
            var bookLoan = new BookLoan(1, 1);

            bookLoan.FinishLoan();

            bookLoan.DomainEvents.Count.Should().Be(1);
            var bookReturnedEvent = bookLoan.DomainEvents.First();

            (bookReturnedEvent is BookLoanFinishedEvent).Should().BeTrue();
        }