public void FindAllRetrievalsTest() { //Arrange int expected = context.Retrieval.ToList().Count; //Act var result = retrievalService.FindAllRetrievals(); //Assert Assert.AreEqual(expected, result.Count); }
public IEnumerable <ManageRetrievalsViewModel> GetAllRetrievals() { List <Retrieval> retList = retrievalService.FindAllRetrievals(); List <ManageRetrievalsViewModel> viewModel = new List <ManageRetrievalsViewModel>(); foreach (Retrieval r in retList) { viewModel.Add(new ManageRetrievalsViewModel { RetrievalId = r.RetrievalId, CreatedBy = r.CreatedBy != null ? String.Format("{0} {1}", r.CreatedBy.FirstName, r.CreatedBy.LastName) : "", CreatedDate = r.CreatedDateTime.ToShortDateString(), Status = r.Status.Name }); } return(viewModel); }