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); } }
public void EmployeeVMGetAllShouldReturnList() { EmployeeViewModel vm = new EmployeeViewModel(); List<EmployeeViewModel> emps = vm.GetAll(); Assert.IsTrue(emps.Count > 0); }