コード例 #1
0
        public void Select_host()
        {
            var emptyServerUrl = InitHelper.RandomPort();
            var cfg            = new HttpSelfHostConfiguration(emptyServerUrl)
            {
                IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always,
                HostNameComparisonMode   = HostNameComparisonMode.Exact
            };
            var server = new HttpSelfHostServer(cfg);

            disposable.Add(server);
            server.OpenAsync().Wait();

            clientConfig = clientConfig.Clone();
            var normalServerUrl = clientConfig.BaseUrl;

            clientConfig.AltUri = emptyServerUrl + "," + normalServerUrl;
            var cmd = new UpdateCommand();

            disposable.Add(cmd);
            cmd.Configure(settings, clientConfig);
            Assert.AreEqual(normalServerUrl, cmd.ConfigureHttp().ToString());
        }