public void AddExistingBookWithQuantityInvalidNotModifyingQuantity(string isbn, string name, int quantity)
        {
            var mockValidator = new Mock <IValidationService>();

            mockValidator.Setup(x => x.IsValidQuantity(quantity)).Returns(false);
            var dependencyService = new DependencyService();

            dependencyService.Register <IValidationService>(mockValidator.Object);
            var availableBooks = new List <BookProductInfo> {
                new BookProductInfo {
                    Book = new Book {
                        ISBN = isbn, Name = name
                    }, Quantity = 1
                }
            };
            var library = new LibraryRepository(availableBooks, dependencyService);

            var addResult = library.AddExistingBook(isbn, quantity);

            Assert.False(addResult);
            var addedBook = Assert.Single(library.AvailableBooks);

            Assert.NotNull(addedBook);
            Assert.Equal(1, addedBook.Quantity);
        }
        public void AddQuantityBookButBookNotFound(string isbn)
        {
            var mockValidator = new Mock <IValidationService>();

            mockValidator.Setup(x => x.IsValidQuantity(1)).Returns(true);
            var dependencyService = new DependencyService();

            dependencyService.Register <IValidationService>(mockValidator.Object);
            var availableBooks = new List <BookProductInfo>();
            var library        = new LibraryRepository(availableBooks, dependencyService);

            var addResult = library.AddExistingBook(isbn);

            Assert.False(addResult);
            Assert.Empty(library.AvailableBooks);
        }