Beispiel #1
0
        public void GetBookTest_PassInValidId_ShouldNotReturnBook()
        {
            // Arrange
            JsonBookRepository jsonBookRepository = new JsonBookRepository();

            // Act
            var actual = jsonBookRepository.GetBook(0);


            //Assert
            Assert.IsNull(actual);
        }
Beispiel #2
0
        public void GetBookTest_PassValidId_ShouldReturnBook()
        {
            // Arrange
            JsonBookRepository jsonBookRepository = new JsonBookRepository();
            Book book = new Book();

            jsonBookRepository.Add(book);

            // Act
            var actual = jsonBookRepository.GetBook(book.Id);


            //Assert
            Assert.AreEqual(actual, book);
        }