public void ClassesDelete() { // Arrange ClassesController controller = new ClassesController(); // Act JsonResult result = controller.Delete(99999) as JsonResult; // Assert Assert.IsFalse(((JsonResultData)result.Data).isOK); }
static void TestClassesController() { var conn = new Connection(Server, Instance, Database); var ClsCtrl = new ClassesController(conn); var classes = ClsCtrl.GetAll(); var class1 = ClsCtrl.GetByPK(1); var mat404 = ClsCtrl.GetByCode("MAT404"); var cls = new Class() { Code = "UBW901", Subject = "Under Water Basket Weaving", Section = 901, InstructorId = null }; var result = ClsCtrl.Insert(cls, "Tensi"); cls = ClsCtrl.GetByCode("UBW901"); cls.InstructorId = 1; result = ClsCtrl.Update(cls); result = ClsCtrl.Delete(cls.Id); conn.Close(); var mathClasses = classes.Where(c => c.Code.StartsWith("MAT")).ToList(); }