Example #1
0
        public void TestCreateDept()
        {
            var dept = new DepartmentViewModel
            {
                DepartmentName = "TecBridge"
            };

            _deptManager.PostDeptBAL(dept);

            var x = _deptManager.GetDeptByNameBAL(dept.DepartmentName);

            Assert.Equal(dept.DepartmentName, x.DepartmentName);
        }
Example #2
0
 public ActionResult PostDepartment(DepartmentViewModel dept)
 {
     if (ModelState.IsValid)
     {
         try
         {
             _deptManager.PostDeptBAL(dept);
         }
         catch (Exception)
         {
             throw;
         }
         return(Ok(dept));
     }
     else
     {
         return(BadRequest(ModelState));
     }
 }