public Task <GetCategoriesQueryResult> Execute(GetCategoriesQuery query) { var data = _dataSource.List(); var models = Mapper.Map <IEnumerable <CategoryData>, IEnumerable <Category> > (data); return(Task.FromResult(new GetCategoriesQueryResult { Categories = models })); }
public Result <List <Category> > List() { var table = ConvertDataTableToList.BindList <Category>(_dataSource.List()); if (table.Count > 0) { return(Result <List <Category> > .Successful(data : table)); } return(Result <List <Category> > .Failure()); }
public void List_categories_should_return_list() { Assert.NotEmpty(_sut.List()); }