public void ReservesOnlyNecessaryFounds()
        {
            var loan        = 1500;
            var distributor = new LoanDistributor();

            var reservedLenders = distributor.GetLowestInterestLenders(lendersList, loan);

            Assert.That(reservedLenders.Lenders.Count, Is.EqualTo(2));

            Assert.That(reservedLenders.Lenders.Single(l => l.Name == "Eve").Founds, Is.EqualTo(500));
        }
        public void GetBestLendersRatesForLoan()
        {
            var loan        = 1500;
            var distributor = new LoanDistributor();

            var reservedLenders = distributor.GetLowestInterestLenders(lendersList, loan);

            Assert.That(reservedLenders.Lenders.Count, Is.EqualTo(2));

            Assert.That(reservedLenders.Lenders.Any(l => l.Name == "Ada"), Is.True);
            Assert.That(reservedLenders.Lenders.Any(l => l.Name == "Eve"), Is.True);
        }
        public void GetOnlyOneLenderWhenLenderHasEnougthFoundsForLoan()
        {
            var loan        = 500;
            var distributor = new LoanDistributor();

            var reservedLenders = distributor.GetLowestInterestLenders(lendersList, loan);

            Assert.That(reservedLenders.Lenders.Count, Is.EqualTo(1));

            var reservedLender = reservedLenders.Lenders.First();

            Assert.That(reservedLender.Name, Is.EqualTo("Ada"));
            Assert.That(reservedLender.Founds, Is.EqualTo(500));
        }