public void AddBook() { // Arrange _retrievalMock .Setup(mock => mock.RetrieveBookInfo(ExistingISBN)) .Returns(DefaultBook()); _daoMock .Setup(mock => mock.Create(It.IsAny <Book>())) .Returns(new Book() { ISBN = ExistingISBN }); // Act string isbn = _bookManagerService.AddBook(ExistingISBN); // Assert Assert.Equal(ExistingISBN, isbn); _retrievalMock.Verify(m => m.RetrieveBookInfo(ExistingISBN), Times.Once); _daoMock.Verify(m => m.Create(It.IsAny <Book>()), Times.Once); }
public string Add(string isbn) { return(_bookManagerService.AddBook(isbn)); }