public void HttpRequestInterceptorCannotBeChangedToNull() { // given var target = new StubOpenKitBuilder(EndpointUrl, DeviceId); // when target.WithHttpRequestInterceptor(null); var obtained = target.HttpRequestInterceptor; // then Assert.That(obtained, Is.Not.Null.And.InstanceOf <NullHttpRequestInterceptor>()); }
public void HttpRequestInterceptorGivesPreviouslySetHttpRequestInterceptor() { // given var httpRequestInterceptor = Substitute.For <IHttpRequestInterceptor>(); var target = new StubOpenKitBuilder(EndpointUrl, DeviceId); // when target.WithHttpRequestInterceptor(httpRequestInterceptor); var obtained = target.HttpRequestInterceptor; // then Assert.That(obtained, Is.SameAs(httpRequestInterceptor)); }