public void Given_Invalid_Type_When_WithHttpClient_Invoked_Then_It_Should_Throw_Exception() { var sink = new FakeSchemaSink(); Action action = () => SchemaSinkExtensions.WithHttpClient(sink, null); action.Should().Throw <ArgumentNullException>(); }
public void Given_Null_Parameters_When_WithHttpClient_Invoked_Then_It_Should_Throw_Exception() { Action action = () => SchemaSinkExtensions.WithHttpClient(null, null); action.Should().Throw <ArgumentNullException>(); action = () => SchemaSinkExtensions.WithHttpClient(new Mock <ISchemaSink>().Object, null); action.Should().Throw <ArgumentNullException>(); }
public void Given_HttpClient_When_WithContainer_Invoked_Then_It_Should_Return_Result() { var sink = new BlobStorageSchemaSink(); var uri = new Uri("https://localhost"); var container = "lorem-ipsum"; var result = SchemaSinkExtensions.WithContainer(sink, container); result .Should().NotBeNull() .And.BeAssignableTo <ISchemaSink>(); }
public void Given_HttpClient_When_WithHttpClient_Invoked_Then_It_Should_Return_Result() { var sink = new BlobStorageSchemaSink(); var uri = new Uri("https://localhost"); var blobClient = new CloudBlobClient(uri); var result = SchemaSinkExtensions.WithBlobClient(sink, blobClient); result .Should().NotBeNull() .And.BeAssignableTo <ISchemaSink>(); }
public void Given_HttpClient_When_WithHttpClient_Invoked_Then_It_Should_Return_Result() { var sink = new HttpSchemaSink(); var httpClient = new HttpClient(); var result = SchemaSinkExtensions.WithHttpClient(sink, httpClient); result .Should().NotBeNull() .And.BeAssignableTo <ISchemaSink>(); httpClient.Dispose(); }