コード例 #1
0
 public void HttpConfigurationIsAppliedToPolling()
 {
     TestHttpUtils.TestWithSpecialHttpConfigurations(
         ValidPollingResponse,
         (targetUri, httpConfig, server) =>
     {
         var config = BasicConfig()
                      .DataSource(Components.PollingDataSource())
                      .Http(httpConfig)
                      .ServiceEndpoints(Components.ServiceEndpoints().Polling(targetUri))
                      .StartWaitTime(TimeSpan.FromSeconds(5))
                      .Build();
         using (var client = new LdClient(config))
         {
             VerifyClientStartedAndHasExpectedData(client, server);
         }
     },
         TestLogger
         );
 }
コード例 #2
0
 public void HttpConfigurationIsAppliedToEvents()
 {
     TestHttpUtils.TestWithSpecialHttpConfigurations(
         EventsAcceptedResponse,
         (targetUri, httpConfig, server) =>
     {
         var config = BasicConfig()
                      .DiagnosticOptOut(true)
                      .Events(Components.SendEvents())
                      .Http(httpConfig)
                      .ServiceEndpoints(Components.ServiceEndpoints().Events(targetUri))
                      .StartWaitTime(TimeSpan.FromSeconds(5))
                      .Build();
         using (var client = new LdClient(config))
         {
             client.Identify(User.WithKey("userkey"));
             client.Flush();
             server.Recorder.RequireRequest();
         }
     },
         TestLogger
         );
 }