예제 #1
0
        public void Return_Unsuccessful_When_Receives_Empty()
        {
            var bookDal = new BookStoreDataMock(bookRentalMock.StoredBooks1());
            var result  = new BookRental(bookDal).RentBook(new RentBook());

            Assert.False(result.Successful);
        }
예제 #2
0
        public void Return_Successful_Return()
        {
            rentBookMock = bookRentalMock.RentReturnBook();
            var bookDal = new BookStoreDataMock(bookRentalMock.StoredBooks2());
            var result  = new BookRental(bookDal).ReturnBook(rentBookMock);

            Assert.True(result.Successful);
        }
예제 #3
0
        public void Return_Unsuccessful_When_Book_Is_Not_Stored()
        {
            rentBookMock = bookRentalMock.RentReturnBook();
            var bookDal = new BookStoreDataMock(bookRentalMock.StoredBooks());
            var result  = new BookRental(bookDal).RentBook(rentBookMock);

            Assert.False(result.Successful);
        }
예제 #4
0
        public void Return_Successful_When_Get_MinimunStock_List()
        {
            var data    = new BookStoreDataMock(testMocks.StoredBooksMinimunStock());
            var manager = new BookManager(data);

            var result = manager.ListMinimunStockBooks();

            var expected = testMocks.AssertStoredBooksMinimunStock().Select(b => b.Book.Title);
            var actual   = result.Content.Select(b => b.Book.Title);

            Assert.Equal(expected, actual);
        }