Пример #1
0
        public void ExistsSchoolVanFail()
        {
            SetUp();
            SchoolVan      newSchoolVan = new SchoolVan();
            SchoolVanLogic testLogic    = new SchoolVanLogic();

            Assert.IsFalse(testLogic.Exists(newSchoolVan));
        }
Пример #2
0
        public void AddSchoolVanSuccess()
        {
            SetUp();
            SchoolVan      newSchoolVan = new SchoolVan();
            SchoolVanLogic testLogic    = new SchoolVanLogic();

            testLogic.Add(newSchoolVan);
            Assert.IsTrue(testLogic.Exists(newSchoolVan));
        }
Пример #3
0
        public void DeleteSchoolVanSuccess()
        {
            SetUp();
            SchoolVan      newSchoolVan = new SchoolVan();
            SchoolVanLogic testLogic    = new SchoolVanLogic();

            testLogic.Add(newSchoolVan);
            newSchoolVan.Id = testLogic.GetNextIdFree() - 1;
            testLogic.Remove(newSchoolVan);
            Assert.IsFalse(testLogic.Exists(newSchoolVan));
        }
Пример #4
0
        public void DeleteSchoolDifferentObjectFail()
        {
            SetUp();
            SchoolVan      newSchoolVan = new SchoolVan();
            SchoolVanLogic testLogic    = new SchoolVanLogic();
            int            testInt      = 0;

            testLogic.Add(newSchoolVan);
            testLogic.Remove(testInt);
            Assert.IsTrue(testLogic.Exists(newSchoolVan));
        }
Пример #5
0
        public void AddInvalidSchoolVan()
        {
            SetUp();
            SchoolVan newSchoolVan = new SchoolVan();

            newSchoolVan.Capacity = -30;
            SchoolVanLogic testLogic = new SchoolVanLogic();

            testLogic.Add(newSchoolVan);
            Assert.IsFalse(testLogic.Exists(newSchoolVan));
        }
Пример #6
0
        public void ModifySchoolVanFailCheckOldSchoolVan()
        {
            SetUp();
            SchoolVanLogic testLogic        = new SchoolVanLogic();
            SchoolVan      newSchoolVan     = new SchoolVan();
            SchoolVan      anotherSchoolVan = new SchoolVan();

            anotherSchoolVan.Id = -3;
            testLogic.Add(newSchoolVan);
            testLogic.Modify(newSchoolVan, anotherSchoolVan);
            Assert.IsTrue(testLogic.Exists(newSchoolVan));
        }
Пример #7
0
        public void ModifySchoolVanModifyNonExistent()
        {
            SetUp();
            SchoolVan schoolVan = new SchoolVan();

            schoolVan.Id = 4;
            SchoolVanLogic testLogic       = new SchoolVanLogic();
            SchoolVan      editedSchoolVan = new SchoolVan();

            editedSchoolVan.Id = 50;
            testLogic.Modify(schoolVan, editedSchoolVan);
            Assert.IsFalse(testLogic.Exists(editedSchoolVan));
        }
Пример #8
0
        public void ModifySchoolVanFail()
        {
            SetUp();
            SchoolVan      schoolVan       = new SchoolVan();
            SchoolVanLogic testLogic       = new SchoolVanLogic();
            SchoolVan      editedSchoolVan = new SchoolVan();

            testLogic.Add(schoolVan);
            schoolVan.Id       = testLogic.GetNextIdFree() - 1;
            editedSchoolVan.Id = testLogic.GetNextIdFree() - 1;
            testLogic.Modify(schoolVan, editedSchoolVan);
            Assert.IsTrue(testLogic.Exists(editedSchoolVan));
        }
Пример #9
0
        public void ModifySchoolVanSuccess()
        {
            SetUp();
            SchoolVan schoolVan = new SchoolVan();

            schoolVan.Id = 4;
            SchoolVanLogic testLogic       = new SchoolVanLogic();
            SchoolVan      editedSchoolVan = new SchoolVan();

            editedSchoolVan.Id = 50;
            testLogic.Add(schoolVan);
            testLogic.Modify(schoolVan, editedSchoolVan);
            Assert.IsTrue(testLogic.Exists(editedSchoolVan));
        }
Пример #10
0
        public void DeleteSchoolVanFail()
        {
            SetUp();
            SchoolVan newSchoolVan = new SchoolVan();

            newSchoolVan.Id = 5;
            SchoolVan anotherSchoolVan = new SchoolVan();

            anotherSchoolVan.Id = 6;
            SchoolVanLogic testLogic = new SchoolVanLogic();

            testLogic.Add(newSchoolVan);
            newSchoolVan.Id = testLogic.GetNextIdFree() - 1;
            testLogic.Remove(anotherSchoolVan);
            Assert.IsTrue(testLogic.Exists(newSchoolVan));
        }