コード例 #1
0
        public void ClearEmptyDiscardList()
        {
            var bookManagerMock = new Mock <IBookManager>();

            bookManagerMock.Setup(m =>
                                  m.GetAllBooksInDiscardList())
            .Returns(new List <Book>());

            var bookAPI = new BookAPI(null, bookManagerMock.Object);
            var result  = bookAPI.ClearDiscardList();

            Assert.AreEqual(ClearDiscardListStatusCodes.NoDiscardBooksToClear, result);
            bookManagerMock.Verify(
                m => m.ClearDiscardList(It.IsAny <List <Book> >()), Times.Never);
        }