public void PenaltyAppliedAfterBorrowTimeExpires(string isbn, string cnp, double price)
        {
            var availableBooks = new List <BookProductInfo>();
            var lendBooks      = new List <Borrowing> {
                new Borrowing {
                    CNP              = cnp,
                    ISBN             = isbn,
                    BorrowingEndDate = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString(),
                    BorrowingPrice   = price
                }
            };
            var library = new LibraryRepository(availableBooks, lendBooks, new DependencyService());

            library.CalculateBorrowPenalty();
            Assert.Equal(AppConstants.LOAN_PENALTY * price + price, Assert.Single(library.BorrowedBooks).BorrowingPrice);
        }
        public void PenaltyNotAppliedIfBookWasReturned(string isbn, string cnp, double price)
        {
            var availableBooks = new List <BookProductInfo>();
            var lendBooks      = new List <Borrowing> {
                new Borrowing {
                    CNP              = cnp,
                    ISBN             = isbn,
                    BorrowingEndDate = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString(),
                    BorrowingPrice   = price,
                    HasBeenReturned  = true
                }
            };
            var library = new LibraryRepository(availableBooks, lendBooks, new DependencyService());

            library.CalculateBorrowPenalty();
            Assert.Equal(price, Assert.Single(library.BorrowedBooks).BorrowingPrice);
        }