Exemplo n.º 1
0
        public void Women1_FromTables()
        {
            decimal bodyWeight   = 60;
            decimal liftedWeight = 70;

            Assert.AreEqual(78.043, WilksFormula.CalculateForWomenUsingTables(bodyWeight, liftedWeight));
        }
Exemplo n.º 2
0
        public void Women2_FromTables()
        {
            decimal bodyWeight   = 100;
            decimal liftedWeight = 340;

            Assert.AreEqual(283.084, WilksFormula.CalculateForWomenUsingTables(bodyWeight, liftedWeight));
        }
Exemplo n.º 3
0
 decimal calculateWilks(Customer customer, decimal bodyWeight, decimal exerciseWeight)
 {
     if (bodyWeight <= 0)
     {
         return(0);
     }
     if (customer.Gender == Gender.Male)
     {
         return(WilksFormula.CalculateForMenUsingTables(bodyWeight, exerciseWeight));
     }
     if (customer.Gender == Gender.Female)
     {
         return(WilksFormula.CalculateForWomenUsingTables(bodyWeight, exerciseWeight));
     }
     throw new ArgumentException("Customer without gender!");
 }
Exemplo n.º 4
0
        private void btnCalculate_Click(object sender, RoutedEventArgs e)
        {
            var bodyKgWeight  = ((double?)BodyWeight).ToSaveWeight();
            var totalKgWeight = ((double?)TotalWeight).ToSaveWeight();

            if (IsMale)
            {
                var result = WilksFormula.CalculateForMenUsingTables(bodyKgWeight, totalKgWeight);
                Wilks = result.ToString("#.####");
            }
            else
            {
                var result = WilksFormula.CalculateForWomenUsingTables(bodyKgWeight, totalKgWeight);
                Wilks = result.ToString("#.####");
            }
        }