Exemplo n.º 1
0
        public void OperationVolumeUnitTest()
        {
            Converter_Volume op1 = new Converter_Volume(50, Converter_Volume.UnitType.UNIT_MILLILITER, Converter_Volume.UnitType.UNIT_LITER);

            Assert.AreEqual(op1.Unit(), "L");
            Converter_Volume op2 = new Converter_Volume(50, Converter_Volume.UnitType.UNIT_LITER, Converter_Volume.UnitType.UNIT_MILLILITER);

            Assert.AreEqual(op2.Unit(), "mL");
        }
        public void TestVolumeConverter()
        {
            //Milliliter Tests
            Converter_Volume mLtomL = new Converter_Volume(5, Converter_Volume.UnitType.UNIT_MILLILITER, Converter_Volume.UnitType.UNIT_MILLILITER);

            Assert.AreEqual(mLtomL.Result(), 5);
            Converter_Volume mLtoL = new Converter_Volume(5, Converter_Volume.UnitType.UNIT_MILLILITER, Converter_Volume.UnitType.UNIT_LITER);

            Assert.AreEqual(mLtoL.Result(), 0.005);

            //Liter Tests
            Converter_Volume LtomL = new Converter_Volume(8, Converter_Volume.UnitType.UNIT_LITER, Converter_Volume.UnitType.UNIT_MILLILITER);

            Assert.AreEqual(LtomL.Result(), 8000);
            Converter_Volume LtoL = new Converter_Volume(8, Converter_Volume.UnitType.UNIT_LITER, Converter_Volume.UnitType.UNIT_LITER);

            Assert.AreEqual(LtoL.Result(), 8);
        }