public void CreatesHttpWebRequestWithoutContentTypeIfNotSpecifiedInConstructor()
            {
                var        transmission = new TestableTransmission(contentType: string.Empty);
                WebRequest request      = transmission.TestableCreateRequest(new Uri("http://uri"));

                Assert.Null(request.ContentType);
            }
            public void CreatesHttpWebRequestWithContentEncodingSpecifiedInConstructor()
            {
                var        transmission = new TestableTransmission(contentEncoding: "TestContentEncoding");
                WebRequest request      = transmission.TestableCreateRequest(new Uri("http://uri"));

                Assert.Equal(transmission.ContentEncoding, request.Headers[HttpRequestHeader.ContentEncoding]);
            }
            public void CreatesHttpWebRequestWithPostMethod()
            {
                var        transmission = new TestableTransmission();
                WebRequest request      = transmission.TestableCreateRequest(new Uri("http://uri"));

                Assert.Equal("POST", request.Method);
            }
            public void CreatesHttpWebRequestWithContentTypeSpecifiedInConstructor()
            {
                var        transmission = new TestableTransmission(contentType: "TestContentType");
                WebRequest request      = transmission.TestableCreateRequest(new Uri("http://uri"));

                Assert.Equal(transmission.ContentType, request.ContentType);
            }
            public void CreatesHttpWebRequestWithContentLengthCalculatedFromDataSpecifiedInConstructor()
            {
                byte[]     content      = Encoding.UTF8.GetBytes("custom data");
                var        transmission = new TestableTransmission(new Uri("http://test.uri"), content);
                WebRequest request      = transmission.TestableCreateRequest(new Uri("http://uri"));

                Assert.Equal(content.Length, request.ContentLength);
            }
            public void CreatesHttpWebRequestWithSpecifiedUri()
            {
                var transmission = new TestableTransmission();

                var        expectedUri = new Uri("http://custom.uri");
                WebRequest request     = transmission.TestableCreateRequest(expectedUri);

                Assert.Equal(expectedUri, request.RequestUri);
            }
 public void CreatesHttpWebRequestWithContentLengthCalculatedFromDataSpecifiedInConstructor()
 {
     byte[] content = Encoding.UTF8.GetBytes("custom data");
     var transmission = new TestableTransmission(new Uri("http://test.uri"), content);
     WebRequest request = transmission.TestableCreateRequest(new Uri("http://uri"));
     Assert.Equal(content.Length, request.ContentLength);
 }
 public void CreatesHttpWebRequestWithContentEncodingSpecifiedInConstructor()
 {
     var transmission = new TestableTransmission(contentEncoding: "TestContentEncoding");
     WebRequest request = transmission.TestableCreateRequest(new Uri("http://uri"));
     Assert.Equal(transmission.ContentEncoding, request.Headers[HttpRequestHeader.ContentEncoding]);
 }
 public void CreatesHttpWebRequestWithoutContentTypeIfNotSpecifiedInConstructor()
 {
     var transmission = new TestableTransmission(contentType: string.Empty);
     WebRequest request = transmission.TestableCreateRequest(new Uri("http://uri"));
     Assert.Null(request.ContentType);
 }
 public void CreatesHttpWebRequestWithContentTypeSpecifiedInConstructor()
 {
     var transmission = new TestableTransmission(contentType: "TestContentType");
     WebRequest request = transmission.TestableCreateRequest(new Uri("http://uri"));
     Assert.Equal(transmission.ContentType, request.ContentType);
 }
 public void CreatesHttpWebRequestWithPostMethod()
 {
     var transmission = new TestableTransmission();
     WebRequest request = transmission.TestableCreateRequest(new Uri("http://uri"));
     Assert.Equal("POST", request.Method);
 }
            public void CreatesHttpWebRequestWithSpecifiedUri()
            {
                var transmission = new TestableTransmission();

                var expectedUri = new Uri("http://custom.uri");
                WebRequest request = transmission.TestableCreateRequest(expectedUri);

                Assert.Equal(expectedUri, request.RequestUri);
            }