Exemplo n.º 1
0
        public void BuildHttpRequestBaseWithContentType()
        {
            var contentType = "ContentType";

            var result = new Builder ()
                .WithContentType (contentType)
                .Build ();

            result.Object.ContentType.Should ().Be (contentType);
        }
Exemplo n.º 2
0
        public void AddToControllerHttpRequestWithHttpMethod()
        {
            var httpMethod = "httpMethod";
            var controller = new ProductsController ();

            var controllerResult = new Builder ()
                .WithHttpMethod (httpMethod)
                .AddTo (controller);

            controllerResult.Request.HttpMethod.Should ().Be (httpMethod);
        }
Exemplo n.º 3
0
        public void AddToControllerHttpRequestWithContentType()
        {
            var contentType = "Content-Type";
            var controller = new ProductsController ();

            var controllerResult = new Builder ()
                .WithContentType (contentType)
                .AddTo (controller);

            controllerResult.Request.ContentType.Should ().Be (contentType);
        }
Exemplo n.º 4
0
        public void AddToControllerHttpRequestWithHeader()
        {
            var header = "header";
            var headerValue = "headerValue";
            var controller = new ProductsController ();

            var controllerResult = new Builder ()
                .WithHeader (header, headerValue)
                .AddTo (controller);

            controllerResult.Request.Headers [header].Should ().Be (headerValue);
        }
Exemplo n.º 5
0
        public void BuildHttpRequestBaseWithHttpMethod()
        {
            var httpMethod = "httpMethod";

            var result = new Builder ()
                .WithHttpMethod (httpMethod)
                .Build ();

            result.Object.HttpMethod.Should ().Be (httpMethod);
        }
Exemplo n.º 6
0
        public void BuildHttpRequestBaseWithHeader()
        {
            var header = "header";
            var headerValue = "headerValue";

            var result = new Builder ()
                .WithHeader (header, headerValue)
                .Build ();

            result.Object.Headers [header].Should ().Be (headerValue);
        }
Exemplo n.º 7
0
        public void BuildHttpRequestBase()
        {
            var result = new Builder().Build ();

            result.Should ().BeOfType<Mock<HttpRequestBase>> ();
        }
Exemplo n.º 8
0
        public void BuildHttpRequestBaseWithMoreThanOneHeader()
        {
            var headerOne = "headerOne";
            var headerValueOne = "headerValueOne";
            var headerTwo = "headerTwo";
            var headerValueTwo = "headerValueTwo";

            var result = new Builder ()
                .WithHeader (headerOne, headerValueOne)
                .WithHeader (headerTwo, headerValueTwo)
                .Build ();

            result.Object.Headers [headerOne].Should ().Be (headerValueOne);
            result.Object.Headers [headerTwo].Should ().Be (headerValueTwo);
        }