예제 #1
0
        public void RadonTest()
        {
            WaterPacket w  = new WaterPacket(12);
            Chemical    C  = ChemicalFactory.Instance.GetChemical(ChemicalNames.Radon);
            Chemical    cl = ChemicalFactory.Instance.GetChemical(ChemicalNames.Cl);

            //Checks old evaporation
            C.IsFirstOrderDegradable = false;

            w.AddChemical(C, 5);
            w.AddChemical(cl, 5);

            Assert.AreEqual(0.4167, w.GetConcentration(C), 0.001);

            w.MoveInTime(TimeSpan.FromDays(1), 6);
            Assert.AreEqual(0.3846, w.GetConcentration(C), 0.001);

            w.MoveInTime(TimeSpan.FromDays(1), 6);
            Assert.AreEqual(0.355, w.GetConcentration(C), 0.001);

            //Checks new Reactions

            double d = w.GetConcentration(C);

            w.MoveInTime(TimeSpan.FromDays(3.8), ChemicalFactory.Instance.LakeReactions, 0);
            Assert.AreEqual(d / 2, w.GetConcentration(C), 0.01);
            Assert.AreEqual(5.0 / 12, w.GetConcentration(cl), 0.01);
        }
예제 #2
0
        public void WaterPacketTest()
        {
            WaterPacket wp1 = new WaterPacket(23);

            ReadWrite(wp1);

            WaterPacket wp = new WaterPacket(1, 250);

            wp.MoveInTime(TimeSpan.FromDays(1), 1);

            WaterPacket wp2 = (WaterPacket)ReadWrite(wp);

            WaterEquals(wp, wp2);
        }