示例#1
0
        public void BuildHttpRequestBaseWithContentType()
        {
            var contentType = "ContentType";

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

            result.Object.ContentType.Should ().Be (contentType);
        }
示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#5
0
        public void BuildHttpRequestBaseWithHttpMethod()
        {
            var httpMethod = "httpMethod";

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

            result.Object.HttpMethod.Should ().Be (httpMethod);
        }
示例#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);
        }
示例#7
0
        public void BuildHttpRequestBase()
        {
            var result = new Builder().Build ();

            result.Should ().BeOfType<Mock<HttpRequestBase>> ();
        }
示例#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);
        }