예제 #1
0
        public void Test_Using_Host_And_IPAddress()
        {
            string ipStr = "10.0.0.1";
            string host  = "api.vcap.me";

            var       uri = new Uri("http://" + host);
            IPAddress ip;

            IPAddress.TryParse(ipStr, out ip);
            var         client      = new VcapClient(uri, ip);
            VcapRequest infoRequest = client.GetRequestForTesting();

            RestClient  restClient  = infoRequest.Client;
            RestRequest restRequest = infoRequest.Request;

            Assert.Equal("http://" + ipStr, restClient.BaseUrl);
            Assert.Equal(host, infoRequest.RequestHostHeader);

            Assert.NotNull(restRequest.JsonSerializer);
            Assert.IsType <NewtonsoftJsonSerializer>(restRequest.JsonSerializer);
        }