Exemplo n.º 1
0
        public void SubstractTest()
        {
            WaterPacket wwc2 = (WaterPacket)WWC.Substract(70);

            Assert.AreEqual(70, wwc2.Volume);

            Assert.IsTrue(wwc2.Chemicals.ContainsKey(Cl));
            Assert.IsTrue(wwc2.Chemicals.ContainsKey(Na));
            Assert.AreEqual(0.7 * 3.0, wwc2.Chemicals[Na], 0.0000001);
            Assert.AreEqual(0.3 * 3.0, WWC.Chemicals[Na], 0.0000001);

            Assert.AreEqual(WWC.GetConcentration(Cl), wwc2.GetConcentration(Cl));
        }
Exemplo n.º 2
0
        public void SubtractTest()
        {
            int         ID1 = 1;
            WaterPacket w   = new WaterPacket(500);

            w.IDForComposition = ID1;

            IWaterPacket w2 = w.Substract(230);

            Assert.AreEqual(270, w.Volume);
            Assert.AreEqual(230, w2.Volume);

            Assert.AreEqual(1, w.Composition[ID1]);
            Assert.AreEqual(1, w.Composition[ID1]);

            IWaterPacket w3 = w.Substract(1000);

            Assert.AreEqual(0, w.Volume);
            Assert.AreEqual(270, w3.Volume);

            Assert.AreEqual(1, w3.Composition[ID1]);
        }