示例#1
0
        [TestCase(new int[] { 3, 1, 42, 12 }, new int[] { -1, 12 }, 3)]   // remove fin
        public void Testremove(int[] add, int[] remove, int nbElem)
        {
            GenericSimplementChainee <int> chaine = new GenericSimplementChainee <int>();

            chaine.SupprimerMaillon(36);
            chaine.AddLast(add[0]);
            chaine.SupprimerMaillon(remove[0]);
            chaine.AddLast(add[1]);
            chaine.AddLast(add[2]);
            chaine.AddLast(add[3]);
            chaine.SupprimerMaillon(remove[1]);

            Assert.AreEqual(chaine.NbElement, nbElem);
        }
示例#2
0
        public void TestEmptyChaineObject()
        {
            Program.Main(new string[2]);
            GenericSimplementChainee <object> chaine = new GenericSimplementChainee <object>();

            chaine.AddFirst(1);
            chaine.SupprimerMaillon(1);

            Assert.AreEqual(chaine.NbElement, 0);
        }