public async Task <IResponse <IEnumerable <LookupItem> > > QueryDatastore_All(string accessor) { var resp = new EnumerableResponse <LookupItem>(); try { var data = await _datastoreContext.All(accessor); if (data == null || (data != null && data.Count() == 0)) { resp.Status = Enums.ResponseStatus.NoResponse; } else { resp.Data = data.OrderBy(x => x.Label); resp.Status = Enums.ResponseStatus.OK; } } catch (Exception e) { resp.Status = Enums.ResponseStatus.Error; resp.Exception = e; } return(resp); }
public async Task Mock_DatastoreContext_All() { var ret = await mock_context.All("test"); Assert.AreEqual(6, ret.Count()); }