private IMiddleware GetTeamsMiddleware(Dictionary <string, string> results) { // Create a connector client, setup with a custom httpclient which will return // the desired result through the TestHttpMessageHandler. var messageHandler = new TestsHttpMessageHandler(results); return(GetTestConnectorClientMiddleware(messageHandler)); }
private IMiddleware GetTeamsMiddleware(string path, JObject result) { // Create a connector client, setup with a custom httpclient which will return // the desired result through the TestHttpMessageHandler. var messageHandler = new TestsHttpMessageHandler(path, result.ToString()); var testHttpClient = new HttpClient(messageHandler); testHttpClient.BaseAddress = new Uri("https://localhost.coffee"); var testConnectorClient = new ConnectorClient(new Uri("http://localhost.coffee/"), new MicrosoftAppCredentials(string.Empty, string.Empty), testHttpClient); return(new TestConnectorClientMiddleware(testConnectorClient)); }
private IMiddleware GetTeamsMiddleware(JObject result, string path = null) { // Create a connector client, setup with a custom httpclient which will return // the desired result through the TestHttpMessageHandler. TestsHttpMessageHandler messageHandler; if (!string.IsNullOrEmpty(path)) { messageHandler = new TestsHttpMessageHandler(path, result.ToString()); } else { messageHandler = new TestsHttpMessageHandler(result.ToString()); } return(GetTestConnectorClientMiddleware(messageHandler)); }