Пример #1
0
        private static IBook CreateMockedBook(int id, string name = "bookName", string isbn        = "isbn", int numberOfPages = 100, string publisher = "publisher",
                                              string country      = "country", MediaType mediaType = MediaType.Hardcover)
        {
            var book = MockRepository.GenerateMock <IBook>();

            book.Stub(x => x.Identifier).Return(id);
            book.Stub(x => x.Name).Return(name);
            book.Stub(x => x.ISBN).Return(isbn);
            book.Stub(x => x.NumberOfPages).Return(numberOfPages);
            book.Stub(x => x.Publisher).Return(publisher);
            book.Stub(x => x.Country).Return(country);
            book.Stub(x => x.MediaType).Return(mediaType);
            book.Stub(x => x.Released).Return(new DateTime(2000, 1, 1));
            book.Stub(x => x.Authors).Return(new List <string> {
                "authorOne"
            });

            return(book);
        }
        private static IBook CreateMockedBook(int id, string name = "bookName", string isbn = "isbn", int numberOfPages = 100, string publisher = "publisher",
            string country = "country", MediaType mediaType = Domain.Books.MediaType.Hardcover)
        {
            var book = MockRepository.GenerateMock<IBook>();
            book.Stub(x => x.Identifier).Return(id);
            book.Stub(x => x.Name).Return(name);
            book.Stub(x => x.ISBN).Return(isbn);
            book.Stub(x => x.NumberOfPages).Return(numberOfPages);
            book.Stub(x => x.Publisher).Return(publisher);
            book.Stub(x => x.Country).Return(country);
            book.Stub(x => x.MediaType).Return(mediaType);
            book.Stub(x => x.Released).Return(new DateTime(2000, 1, 1));
            book.Stub(x => x.Authors).Return(new List<string> { "authorOne" });

            return book;
        }