Esempio n. 1
0
        public void LoadWithDetails()
        {
            // Arrange
            Book bookFixture = DefaultBook();

            _daoMock
            .Setup(mock => mock.Load(It.IsAny <string>()))
            .Returns(bookFixture);

            // Act
            var book = _bookManagerService.LoadWithDetails(NewGuid());

            // Assert
            Assert.Equal(bookFixture.ISBN, book.ISBN);
            Assert.Equal(bookFixture.Title, book.Title);
            Assert.Equal(bookFixture.Author, book.Author);
            Assert.Equal(bookFixture.Genre, book.Genre);
            _daoMock.Verify(mock => mock.Load(It.IsAny <string>()), Times.Once);
        }
Esempio n. 2
0
 public BookDto LoadDetailed(string id)
 {
     return(_bookManagerService.LoadWithDetails(id));
 }