コード例 #1
0
 public IHttpActionResult Get()
 {
     try
     {
         EmployeeViewModel emp = new EmployeeViewModel();
         List<EmployeeViewModel> allEmployees = emp.GetAll();
         return Ok(allEmployees);
     } catch (Exception ex)
     {
         return BadRequest("Retrive failed - " + ex.Message);
     }
 }
コード例 #2
0
 public void EmployeeVMGetAllShouldReturnList()
 {
     EmployeeViewModel vm = new EmployeeViewModel();
     List<EmployeeViewModel> emps = vm.GetAll();
     Assert.IsTrue(emps.Count > 0);
 }