示例#1
0
        //[Test]
        // This is an integration test - use for testing changes, but it will not always pass because it relies on local changeable data
        public void WebChatApiRequest()
        {
            var source   = new WebChatSettingsFromApi(new Uri("https://www.eastsussex.gov.uk/umbraco/api/webchat/getwebchaturls"), new ConfigurationProxyProvider());
            var settings = source.ReadWebChatSettings();

            settings.PageUrl = new Uri("/some-relative-url");
            Assert.AreEqual("/yourcouncil/", settings.WebChatUrls[0].ToString());
        }
        //[Fact]
        // This is an integration test - use for testing changes, but it will not always pass because it relies on local changeable data
        public async Task WebChatApiRequest()
        {
            var apiSettings = Options.Create(new WebChatApiSettings {
                WebChatSettingsUrl = new Uri("https://www.eastsussex.gov.uk/umbraco/api/webchat/getwebchaturls")
            });
            var source   = new WebChatSettingsFromApi(apiSettings, new HttpClientProvider(new ConfigurationProxyProvider()), null);
            var settings = await source.ReadWebChatSettings();

            settings.PageUrl = new Uri("/some-relative-url");
            Assert.Equal("/yourcouncil/", settings.WebChatUrls[0].ToString());
        }