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(); }
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(); }