Esempio n. 1
0
 public void BodyMassIndex_Bmi_SampleTest()
 {
     Assert.AreEqual("Normal", BodyMassIndex.Bmi(80, 1.80));
     Assert.AreEqual("Normal", BodyMassIndex.Bmi(80, 1.80));
     Assert.AreEqual("Overweight", BodyMassIndex.Bmi(90, 1.80));
     Assert.AreEqual("Obese", BodyMassIndex.Bmi(110, 1.80));
 }
Esempio n. 2
0
 public void BodyMassIndex_Bmi_RandomTest()
 {
     for (int i = 0; i < 100; ++i)
     {
         double weight   = rnd.NextDouble() * 250 + 50;
         double height   = rnd.NextDouble() * 2.5 + 0.5;
         string expected = Solution(weight, height);
         string actual   = BodyMassIndex.Bmi(weight, height);
         Assert.AreEqual(expected, actual);
     }
 }