Exemple #1
0
        public void ShouldGetBookById()
        {
            //Arrange
            CBook testBook = new CBook {
                Id = 1, Name = "Test-Driven Development by Example", AuthorsIds = new Int32[] { 1 }
            };

            //Act
            CBook bookFromMock = interactorUnderTest.GetBookById(1);

            //Assert
            testBook.Should().BeEquivalentTo(bookFromMock);
        }
Exemple #2
0
        public void ShouldGetBooksByAuthor()
        {
            //Arrange
            IEnumerable <CBook> testBooks = new CBook[]
            { new CBook {
                  Id = 2, Name = "Compilers: Principles, Techniques, and Tools", AuthorsIds = new Int32[] { 2, 3, 4, 5 }
              },
              new CBook {
                  Id = 5, Name = "Foundations of Computer Science", AuthorsIds = new int[] { 2, 5 }
              } };
            //Act
            IEnumerable <CBook> booksFromMock = interactorUnderTest.GetBooksByAuthorId(2);

            //Assert
            testBooks.Should().BeEquivalentTo(booksFromMock);
        }