Пример #1
0
        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
            }));
        }
Пример #2
0
        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());
        }
Пример #3
0
 public void List_categories_should_return_list()
 {
     Assert.NotEmpty(_sut.List());
 }