public void BuilderWithServerIdPropagatesToInstance() { // given const int serverId = 1; var target = new HttpClientConfiguration.Builder().WithServerId(serverId); // when var obtained = target.Build(); // then Assert.That(obtained.ServerId, Is.EqualTo(serverId)); }
public void BuilderWithTrustManagerPropagatesToInstance() { // given var trustManager = Substitute.For <ISSLTrustManager>(); var target = new HttpClientConfiguration.Builder().WithTrustManager(trustManager); // when var obtained = target.Build(); // then Assert.That(obtained.SslTrustManager, Is.SameAs(trustManager)); }
public void BuilderWithApplicationIdPropagatesToInstance() { // given const string applicationId = "some cryptic appId"; var target = new HttpClientConfiguration.Builder().WithApplicationId(applicationId); // when var obtained = target.Build(); // then Assert.That(obtained.ApplicationId, Is.EqualTo(applicationId)); }
public void BuilderWithBaseUrlPropagatesToInstance() { // given const string baseUrl = "https://localhost:9999/1"; var target = new HttpClientConfiguration.Builder().WithBaseUrl(baseUrl); // when var obtained = target.Build(); // then Assert.That(obtained.BaseUrl, Is.EqualTo(baseUrl)); }
public void BuilderWithHttpResponseInterceptorPropagatesToInstance() { // given var httpResponseInterceptor = Substitute.For <IHttpResponseInterceptor>(); var target = new HttpClientConfiguration.Builder() .WithHttpResponseInterceptor(httpResponseInterceptor); // when var obtained = target.Build(); // then Assert.That(obtained.HttpResponseInterceptor, Is.SameAs(httpResponseInterceptor)); }
public void EmptyBuilderCreatesEmptyInstance() { // given var target = new HttpClientConfiguration.Builder(); // when var obtained = target.Build(); // then Assert.That(obtained.BaseUrl, Is.Null); Assert.That(obtained.ApplicationId, Is.Null); Assert.That(obtained.SslTrustManager, Is.Null); Assert.That(obtained.ServerId, Is.EqualTo(-1)); }