Esempio n. 1
0
        public static ChatServiceClient CreateTestServerAndClient()
        {
            var serviceUri = GetServiceUri();

            // we can see this in VSTS to ensure that the deployment verification tests actually ran against the deployment
            Console.WriteLine($"Test Service Uri is {serviceUri}");

            if (serviceUri == null)
            {
                var server = new TestServer(WebServer.CreateWebHostBuilder());
                return(new ChatServiceClient(server.CreateClient()));
            }

            var httpClient = new HttpClient {
                BaseAddress = serviceUri
            };

            return(new ChatServiceClient(httpClient));
        }
Esempio n. 2
0
 public void TestInitialize()
 {
     server            = new TestServer(WebServer.CreateWebHostBuilder());
     httpClient        = server.CreateClient();
     chatServiceClient = new ChatServiceClient(httpClient);
 }