private void TestQuestionMethod(StackyClient client) { using (var context = new AsynchronusTestContext(this)) { IEnumerable <Question> received = null; ApiException exception = null; bool completed = false; EnqueueCallback(() => { client.GetQuestions(results => { received = results; completed = true; }, error => { exception = error; completed = true; }); }); EnqueueConditional(() => completed); EnqueueCallback(() => Assert.IsNull(exception)); EnqueueCallback(() => Assert.IsNotNull(received)); } }
public IEnumerable <Stacky.Question> GetQuestions(Stacky.Site site, string[] tags) { var siteClient = new StackyClient("1.0", "", site, new UrlClient(), new JsonProtocol()); QuestionOptions qo = new QuestionOptions(); qo.IncludeBody = true; qo.Max = 1000; qo.Tags = tags; return(siteClient.GetQuestions(qo)); }
public IEnumerable <Stacky.Question> GetQuestions(string site) { Stacky.Site apiSite = GetSiteByName(site); var siteClient = new StackyClient("1.0", "", apiSite, new UrlClient(), new JsonProtocol()); QuestionOptions qo = new QuestionOptions(); qo.IncludeBody = true; qo.Max = 1000; return(siteClient.GetQuestions(qo)); }