public void ShouldGetAuthorById() { //Arrange CAuthor testAuthor = new CAuthor { Id = 2, Name = "Alfred Vaino Aho", BooksIds = new Int32[] { 2, 5 } }; //Act CAuthor authorFromMock = interactorUnderTest.GetAuthorById(2); //Assert testAuthor.Should().BeEquivalentTo(authorFromMock); }
public void ShouldGetAuthorsByBook() { //Arrange IEnumerable <CAuthor> testAuthors = new CAuthor[] { new CAuthor { Id = 2, Name = "Alfred Vaino Aho", BooksIds = new Int32[] { 2, 5 } }, new CAuthor { Id = 3, Name = "Monica S. Lam", BooksIds = new Int32[] { 2 } }, new CAuthor { Id = 4, Name = "Ravi Sethi", BooksIds = new Int32[] { 2 } }, new CAuthor { Id = 5, Name = "Jeffrey D. Ullman", BooksIds = new Int32[] { 2, 5 } }, }; //Act IEnumerable <CAuthor> authorsFromMock = interactorUnderTest.GetAuthorsByBook(2); //Assert testAuthors.Should().BeEquivalentTo(authorsFromMock); }