Exemplo n.º 1
0
        public void GetById_GivenDifferentId_ReturnsDifferentBook()
        {
            // Arrange
            var expectedBookTitle = "Beowulf";
            IBookLibraryRepository bookLibraryRepository =
                new BookLibraryStaticMemoryRepository();

            // Act
            var actual = bookLibraryRepository.GetById(2);

            // Assert
            actual.Title.Should().Be(expectedBookTitle);
        }
Exemplo n.º 2
0
        public void GetById_GivenValidId_ReturnsBook()
        {
            // Arrange
            var expectedBookTitle = "Captain Underpants";
            IBookLibraryRepository bookLibraryRepository =
                new BookLibraryStaticMemoryRepository();

            // Act
            var actual = bookLibraryRepository.GetById(3);

            // Assert
            actual.Title.Should().Be(expectedBookTitle);
        }
Exemplo n.º 3
0
        public void Get_GivenDifferentBookId_ReturnDifferentBook()
        {
            // Arrange
            var expectedBookTitle = "Where the Red Fern Grows";
            IBookLibraryRepository bookLibraryRepository =
                new BookLibraryStaticMemoryRepository();
            var controller = new BookLibraryController(bookLibraryRepository);

            // Act
            var actual = controller.Get(4);

            // Assert
            actual.Value.Title.Should().Be(expectedBookTitle);
        }
Exemplo n.º 4
0
        public void Get_GivenBookId_ReturnBook()
        {
            // Arrange
            var expectedBookTitle = "Captain Underpants";
            IBookLibraryRepository bookLibraryRepository =
                new BookLibraryStaticMemoryRepository();
            var controller = new BookLibraryController(bookLibraryRepository);

            // Act
            var actual = controller.Get(3);

            // Assert
            actual.Value.Title.Should().Be(expectedBookTitle);
        }