Пример #1
0
        public void TestCreateDeleteStades()
        {
            DalManager manager = new DalManager();
            List<Stade> list1 = manager.getStades();

            Stade newStade = new Stade(12, 1000, "PlaneteTest", null);

            manager.InsertStade(newStade);
            List<Stade> listTemp = list1;
            listTemp.Add(newStade);

            List<Stade> list2 = manager.getStades();
            Assert.AreEqual(listTemp.Count, list2.Count);
            Assert.AreEqual(list1[listTemp.Count - 1].ID, list2[list2.Count - 1].ID);
            Assert.AreEqual(list1[listTemp.Count - 1].NbPlaces, list2[list2.Count - 1].NbPlaces);
            Assert.AreEqual(list1[listTemp.Count - 1].Planete, list2[list2.Count - 1].Planete);

            manager.DeleteStades(newStade);
            list2 = manager.getStades();
            Assert.AreEqual(list1.Count, list2.Count);
            Assert.AreEqual(list1[list1.Count - 1].ID, list2[list2.Count - 1].ID);
            Assert.AreEqual(list1[list1.Count - 1].NbPlaces, list2[list2.Count - 1].NbPlaces);
            Assert.AreEqual(list1[list1.Count - 1].Planete, list2[list2.Count - 1].Planete);
        }