public void Student_GetAllTest()
        {
            StudentViewModel        vm          = new StudentViewModel();
            List <StudentViewModel> allStudents = vm.GetAll();

            Assert.True(allStudents.Count > 0);
        }
Exemple #2
0
 public IHttpActionResult GetAll()
 {
     try
     {
         StudentViewModel        stu         = new StudentViewModel();
         List <StudentViewModel> allStudents = stu.GetAll();
         return(Ok(allStudents));
     }
     catch (Exception ex)
     {
         return(BadRequest("Retrieve failed - " + ex.Message));
     }
 }