Exemplo n.º 1
0
 public void Setup()
 {
     allAuthors = new List <CAuthor>
     {
         new CAuthor {
             Id = 1, Name = "Kent Beck", BooksIds = new Int32[] { 1 }
         },
         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 }
         },
         new CAuthor {
             Id = 6, Name = "Steven S. Skiena", BooksIds = new Int32[] { 3 }
         },
         new CAuthor {
             Id = 7, Name = "Christopher J. Date", BooksIds = new Int32[] { 4 }
         }
     };
     interactorUnderTest = new CMockAuthorsInteractor();
 }
Exemplo n.º 2
0
        public void ShouldGetAuthorsNamesByBookId()
        {
            //Arrange
            String[] testAuthorsNames      = new String[] { "Alfred Vaino Aho", "Monica S. Lam", "Ravi Sethi", "Jeffrey D. Ullman" };
            CMockAuthorsInteractor authors = new CMockAuthorsInteractor();
            //Act
            IEnumerable <String> authorNamesFromMock = interactorUnderTest.GetAuthorsNamesByBookId(2, authors);

            //Assert
            testAuthorsNames.Should().BeEquivalentTo(authorNamesFromMock);
        }