public void Put()
        {
            var repository = new Mock<IRepository<Dependent>>();
            var controller = new DependentController(repository.Object);
            var dependent = new Dependent();

            repository.Setup(x => x.SaveOrUpdate(dependent));
            controller.Put(dependent);

            repository.Verify();
        }
        public void CalculateWhenDependent()
        {
            var calculator = new InitialCostCalculator();
            var dependent = new Dependent {
                InitialCostOfBenefits = 2323
            };

            var actual = calculator.Calculate(dependent);

            Assert.AreEqual(dependent.InitialCostOfBenefits, actual);
        }
        public void CalculateForDependent(string name, double expected)
        {
            var calculator = new NameStartsWithLetterADiscountCalculator();
            var dependent = new Dependent {
                Name = name,
                InitialCostOfBenefits = 100,
                NameStartsWithLetterADiscountRate = .10
            };

            var actual = calculator.Calculate(dependent);

            Assert.AreEqual(expected, actual);
        }
 public double Calculate(Dependent dependent)
 {
     return CalculateDiscount(dependent.Name, dependent.NameStartsWithLetterADiscountRate, dependent.InitialCostOfBenefits);
 }
 public void Put(Dependent dependent)
 {
     repository.SaveOrUpdate(dependent);
 }
 public double Calculate(Dependent dependent)
 {
     return dependent.InitialCostOfBenefits;
 }