Beispiel #1
0
        public void CreateBook_ValidBookSuppliedAsParameter_CreatesAndReturnsNewBook
            (string title, int authorId, decimal price)
        {
            var validInput = new Book
            {
                Title    = title,
                AuthorId = authorId,
                Price    = price
            };

            var highestCurrentBookId = AllBooks.Max(book => book.Id);

            var expectedResult = new Book
            {
                Title    = title,
                AuthorId = authorId,
                Price    = price,
                Id       = highestCurrentBookId + 1
            };

            var result = BookRepository.CreateBook(validInput);

            result.Should().BeEquivalentTo(expectedResult);
        }