Ejemplo n.º 1
0
        public void Residence_TestExtraction()
        {
            List <Appareil> extraction = maison.extraireAppareils(0.0);

            Assert.IsNotNull(extraction);
            Assert.AreEqual(2, extraction.Count);
            Assert.IsTrue(extraction.Contains(plinthe));
            Assert.IsTrue(extraction.Contains(ampoule));

            extraction = maison.extraireAppareils(1.25);
            Assert.IsNotNull(extraction);
            Assert.AreEqual(2, extraction.Count);
            Assert.IsTrue(extraction.Contains(plinthe));
            Assert.IsTrue(extraction.Contains(ampoule));

            extraction = maison.extraireAppareils(2.0);
            Assert.IsNotNull(extraction);
            Assert.AreEqual(1, extraction.Count);
            Assert.IsTrue(extraction.Contains(ampoule));

            extraction = maison.extraireAppareils(11.0);
            Assert.IsNotNull(extraction);
            Assert.AreEqual(0, extraction.Count);

            maison.ajouterUtilisation(60, plinthe);
            extraction = maison.extraireAppareils(1.0);
            Assert.IsNotNull(extraction);
            Assert.AreEqual(2, extraction.Count);
            Assert.IsTrue(extraction.Contains(ampoule));
            Assert.IsTrue(extraction.Contains(plinthe));

            extraction = maison.extraireAppareils(1.25);
            Assert.IsNotNull(extraction);
            Assert.AreEqual(2, extraction.Count);
            Assert.IsTrue(extraction.Contains(ampoule));
            Assert.IsTrue(extraction.Contains(plinthe));

            extraction = maison.extraireAppareils(0.5);
            Assert.IsNotNull(extraction);
            Assert.AreEqual(2, extraction.Count);
            Assert.IsTrue(extraction.Contains(ampoule));
            Assert.IsTrue(extraction.Contains(plinthe));

            extraction = maison.extraireAppareils(3);
            Assert.IsNotNull(extraction);
            Assert.AreEqual(1, extraction.Count);
            Assert.IsTrue(extraction.Contains(ampoule));
        }