Example #1
0
        public void Test5c()
        {
            Weight weight = new Weight();

            weight.NavigateTo();
            Thread.Sleep(2000);
            weight.SetUnits(Helper.Units.Ounces, Helper.Units.Grams);
            int    value  = random.Next(0, 100000);
            double result = weight.Convert(value, "g");

            int fractionLength = Helper.GetFractionLength(result);

            if (fractionLength > 0)
            {
                result = Math.Round(result, fractionLength);
            }

            Assert.AreEqual(weight.CalculateExpect(value, Helper.Units.Ounces, Helper.Units.Grams, fractionLength), result);
        }