Пример #1
0
        public void LoadAllSchoolVans(ListBox list)
        {
            SchoolVanLogic   logic      = new SchoolVanLogic();
            List <SchoolVan> allObjects = new List <SchoolVan>();

            allObjects = logic.GetSchoolVansSortedByCapacity();
            if (allObjects.Count == 0)
            {
                throw new NoSchoolVanInSystemException("No hay Camionetas ingresadas en el sistema");
            }
            foreach (SchoolVan item in allObjects)
            {
                list.Items.Add(item);
            }
        }
Пример #2
0
        public void ModifySchoolVanWithTheSameId()
        {
            SetUp();
            SchoolVanLogic testLogic = new SchoolVanLogic();
            SchoolVan      schoolVan = new SchoolVan();

            schoolVan.Id       = 4;
            schoolVan.Capacity = 14;
            SchoolVan updateSchoolVan = new SchoolVan();

            updateSchoolVan.Id       = 4;
            updateSchoolVan.Capacity = 4;
            testLogic.Add(schoolVan);
            testLogic.Modify(schoolVan, updateSchoolVan);
            List <SchoolVan> list      = testLogic.GetSchoolVansSortedByCapacity();
            bool             assertion = false;

            if (list.Count != 0)
            {
                SchoolVan test = list.ElementAt(0);
                assertion = test.Capacity.Equals(4);
            }
            Assert.IsTrue(assertion);
        }