Exemplo n.º 1
0
        public void ShouldReturnHostAndQueryString()
        {
            //Arrange
            var hostHelper  = new HostHelper(new CurrentEnvironment("local"));
            var httpContext = new DefaultHttpContext();

            httpContext.Request.Host        = new HostString("host.com");
            httpContext.Request.Scheme      = "http";
            httpContext.Request.QueryString = QueryString.Create(new List <KeyValuePair <string, string> >
            {
                new KeyValuePair <string, string>("test", "test")
            });

            //Act
            var request = httpContext.Request;

            //Assert
            hostHelper.GetHostAndQueryString(request).Should().Be("http://host.com?test=test");
        }