コード例 #1
0
 public void Should_get_url_without_feature_type()
 {
     var configuration = Substitute.For<IProviderConfiguration>();
     configuration.FeatureType.Returns((string)null);
     configuration.WebApiHost.Returns("http://localhost:8080/api");
     var webApiUrl = new WebApiUrl(configuration);
     var finalUrl = webApiUrl.Get();
     Check.That(finalUrl.AbsoluteUri).IsEqualTo("http://localhost:8080/api/all");
 }
コード例 #2
0
 public void Should_get__clean_url_if_host_provided_with_slash()
 {
     var configuration = Substitute.For<IProviderConfiguration>();
     configuration.FeatureType.Returns("demo");
     configuration.WebApiHost.Returns("http://localhost:8080/api/");
     var webApiUrl = new WebApiUrl(configuration);
     var finalUrl = webApiUrl.Get();
     Check.That(finalUrl.AbsoluteUri).IsEqualTo("http://localhost:8080/api/demo");
 }
コード例 #3
0
 public WebApiProviderInitialisation(TimeSpan pollingDelay, WebApiUrl url)
 {
     _pollingDelay = pollingDelay;
     _url = url;
     _features = new List<FeatureToggleDto>();
 }