Пример #1
0
        public async Task GeneratedLinksWithActionResults_AreRelativeLinks_WhenSetOnLocationHeader(
            string url,
            string expected)
        {
            // Arrange
            var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client = server.CreateClient();

            // Act

            // The host is not important as everything runs in memory and tests are isolated from each other.
            var response = await client.GetAsync(url);

            var responseContent = await response.Content.ReadAsStringAsync();

            // Assert
            Assert.Equal(HttpStatusCode.Redirect, response.StatusCode);

            Assert.Equal(expected, response.Headers.Location.ToString());
        }
Пример #2
0
        public async Task NoRequestContentType_Selects_IfASingleActionWithConstraintIsPresent()
        {
            // Arrange
            var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client = server.CreateClient();

            var request = new HttpRequestMessage(
                HttpMethod.Post,
                "http://localhost/ConsumesAttribute_PassThrough/CreateProduct");

            // Act
            var response = await client.SendAsync(request);

            var product = JsonConvert.DeserializeObject <Product>(
                await response.Content.ReadAsStringAsync());

            // Assert
            Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
            Assert.Null(product);
        }
Пример #3
0
        public async Task ClassLevelHeadersAreUnsetByActionLevelHeaders()
        {
            // Arrange
            var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client = server.CreateClient();

            // Act
            var response = await client.GetAsync("http://localhost/ClassLevelNoStore/CacheThisAction");

            // Assert
            var data = Assert.Single(response.Headers.GetValues("Vary"));

            Assert.Equal("Accept", data);
            data = Assert.Single(response.Headers.GetValues("Cache-control"));
            AssertHeaderEquals("public, max-age=10", data);
            IEnumerable <string> pragmaValues;

            response.Headers.TryGetValues("Pragma", out pragmaValues);
            Assert.Null(pragmaValues);
        }
Пример #4
0
        public async Task XmlSerializerFailsAndDataContractSerializerIsCalled()
        {
            // Arrange
            var server  = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client  = server.CreateClient();
            var request = new HttpRequestMessage(HttpMethod.Post,
                                                 "http://localhost/DataContractSerializer/GetPerson?name=HelloWorld");

            request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml;charset=utf-8"));

            // Act
            var response = await client.SendAsync(request);

            //Assert
            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            Assert.Equal("<Person xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" " +
                         "xmlns=\"http://schemas.datacontract.org/2004/07/FormatterWebSite\">" +
                         "<Name>HelloWorld</Name></Person>",
                         await response.Content.ReadAsStringAsync());
        }
Пример #5
0
        public async Task XmlSerializerOutputFormatter_WhenDerivedClassIsReturned()
        {
            // Arrange
            var server  = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client  = server.CreateClient();
            var request = new HttpRequestMessage(
                HttpMethod.Post, "http://localhost/XmlSerializer/GetDerivedDummyClass?sampleInput=10");

            request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml;charset=utf-8"));

            // Act
            var response = await client.SendAsync(request);

            //Assert
            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            Assert.Equal("<DummyClass xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " +
                         "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xsi:type=\"DerivedDummyClass\">" +
                         "<SampleInt>10</SampleInt><SampleIntInDerived>50</SampleIntInDerived></DummyClass>",
                         await response.Content.ReadAsStringAsync());
        }
Пример #6
0
        public async Task CreatedResult_SetsQualifiedPathInLocationHeader()
        {
            // Arrange
            var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client = server.CreateClient();

            var request = new HttpRequestMessage(
                HttpMethod.Post,
                "http://localhost/ActionResultsVerification/GetCreatedQualified");

            // Act
            var response = await client.SendAsync(request);

            // Assert
            Assert.Equal(HttpStatusCode.Created, response.StatusCode);
            Assert.Equal(
                "http://localhost/ActionResultsVerification/GetDummy/1",
                response.Headers.Location.OriginalString);
            Assert.Equal("{\"SampleInt\":10,\"SampleString\":\"Foo\"}", await response.Content.ReadAsStringAsync());
        }
Пример #7
0
        public async Task CacheTagHelper_DoesNotCacheIfDisabled()
        {
            // Arrange
            var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client = server.CreateClient();

            client.BaseAddress = new Uri("http://localhost");

            // Act
            var response1 = await client.GetStringAsync("/catalog/GetDealPercentage/20?isEnabled=true");

            var response2 = await client.GetStringAsync("/catalog/GetDealPercentage/40?isEnabled=true");

            var response3 = await client.GetStringAsync("/catalog/GetDealPercentage/30?isEnabled=false");

            // Assert
            Assert.Equal("Deal percentage is 20", response1.Trim());
            Assert.Equal("Deal percentage is 20", response2.Trim());
            Assert.Equal("Deal percentage is 30", response3.Trim());
        }
Пример #8
0
        public async Task BadRequestResult_CanBeReturned()
        {
            // Arrange
            var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client = server.CreateClient();
            var input  = "{\"SampleInt\":10}";

            var request = new HttpRequestMessage(
                HttpMethod.Post,
                "http://localhost/ActionResultsVerification/GetBadResult");

            request.Content = new StringContent(input, Encoding.UTF8, "application/json");

            // Act
            var response = await client.SendAsync(request);

            // Assert
            Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
            Assert.Equal("", await response.Content.ReadAsStringAsync());
        }
Пример #9
0
        public async Task RoundTrippedValues_GetsModelBound_ForNumericIndexedProperties()
        {
            // Arrange
            var expected = 12;
            var server   = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client   = server.CreateClient();

            // Act
            var expression = await client.GetStringAsync("http://localhost/RoundTrip/GetPersonDependentAge");

            var keyValuePairs = new[]
            {
                new KeyValuePair <string, string>(expression, expected.ToString())
            };
            var result = await GetPerson(client, keyValuePairs);

            // Assert
            Assert.Equal("Dependents[0].Age", expression);
            Assert.Equal(expected, result.Dependents[0].Age);
        }
Пример #10
0
        public async Task RoundTrippedValues_GetsModelBound_ForSimpleExpressions()
        {
            // Arrange
            var expected = "test-name";
            var server   = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client   = server.CreateClient();

            // Act
            var expression = await client.GetStringAsync("http://localhost/RoundTrip/GetPerson");

            var keyValuePairs = new[]
            {
                new KeyValuePair <string, string>(expression, expected)
            };
            var result = await GetPerson(client, keyValuePairs);

            // Assert
            Assert.Equal("Name", expression);
            Assert.Equal(expected, result.Name);
        }
Пример #11
0
        public async Task CanRender_SimpleViews()
        {
            // Arrange
            var server          = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client          = server.CreateClient();
            var expectedContent = await _resourcesAssembly.ReadResourceAsStringAsync("compiler/resources/BasicWebSite.Home.PlainView.html");

            var expectedMediaType = MediaTypeHeaderValue.Parse("text/html; charset=utf-8");


            // Act
            var response = await client.GetAsync("http://localhost/Home/PlainView");

            var responseContent = await response.Content.ReadAsStringAsync();

            // Assert
            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            Assert.Equal(expectedMediaType, response.Content.Headers.ContentType);
            Assert.Equal(expectedContent, responseContent);
        }
Пример #12
0
        public async Task ResourceFilter_ChangesOutputFormatters_JsonReturned()
        {
            // Arrange
            var input = "{ sampleInt: 10 }";

            var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client = server.CreateClient();

            var request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/Json");

            request.Content = new StringContent(input, Encoding.UTF8, "application/json");

            // Act
            var response = await client.SendAsync(request);

            // Assert
            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType);
            Assert.Equal("\"10\"", await response.Content.ReadAsStringAsync());
        }
        public async Task ModelMetaDataTypeAttribute_ValidBaseClass_EmptyResponseBody()
        {
            // Arrange
            var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client = server.CreateClient();
            var input  = "{ \"Name\": \"MVC\", \"Contact\":\"4258959019\", \"Category\":\"Technology\"," +
                         "\"CompanyName\":\"Microsoft\", \"Country\":\"USA\",\"Price\": 21, \"ProductDetails\": {\"Detail1\": \"d1\"," +
                         " \"Detail2\": \"d2\", \"Detail3\": \"d3\"}}";
            var content = new StringContent(input, Encoding.UTF8, "application/json");

            var url = "http://localhost/ModelMetadataTypeValidation/ValidateProductViewModelIncludingMetadata";

            // Act
            var response = await client.PostAsync(url, content);

            // Assert
            var body = await response.Content.ReadAsStringAsync();

            Assert.Equal("{}", body);
        }
        public async Task CanWrite_WrappedTypes_Empty(string url)
        {
            // Arrange
            var server  = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client  = server.CreateClient();
            var request = new HttpRequestMessage(HttpMethod.Get, url);

            request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml-dcs"));

            // Act
            var response = await client.SendAsync(request);

            //Assert
            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            var result = await response.Content.ReadAsStringAsync();

            XmlAssert.Equal("<ArrayOfPersonWrapper xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\"" +
                            " xmlns=\"http://schemas.datacontract.org/2004/07/XmlFormattersWebSite\" />",
                            result);
        }
Пример #15
0
        public async Task ViewRendersTempData()
        {
            // Arrange
            var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client = server.CreateClient();
            var nameValueCollection = new List <KeyValuePair <string, string> >
            {
                new KeyValuePair <string, string>("value", "Foo"),
            };
            var content = new FormUrlEncodedContent(nameValueCollection);

            // Act
            var response = await client.PostAsync("http://localhost/Home/DisplayTempData", content);

            // Assert
            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            var body = await response.Content.ReadAsStringAsync();

            Assert.Equal("Foo", body);
        }
        public async Task CanWrite_NonWrappedTypes_NullInstance(string url)
        {
            // Arrange
            var server  = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client  = server.CreateClient();
            var request = new HttpRequestMessage(HttpMethod.Get, url);

            request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml-dcs"));

            // Act
            var response = await client.SendAsync(request);

            //Assert
            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            var result = await response.Content.ReadAsStringAsync();

            XmlAssert.Equal("<ArrayOfstring i:nil=\"true\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\"" +
                            " xmlns=\"http://schemas.microsoft.com/2003/10/Serialization/Arrays\" />",
                            result);
        }
Пример #17
0
        public async Task TempData_InvalidType_Throws()
        {
            // Arrange
            var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client = server.CreateClient();
            var nameValueCollection = new List <KeyValuePair <string, string> >
            {
                new KeyValuePair <string, string>("value", "Foo"),
            };
            var content = new FormUrlEncodedContent(nameValueCollection);

            // Act & Assert
            var exception = await Assert.ThrowsAsync <InvalidOperationException>(async() =>
            {
                await client.PostAsync("/Home/SetTempDataInvalidType", content);
            });

            Assert.Equal("The '" + typeof(SessionStateTempDataProvider).FullName + "' cannot serialize an object of type '" +
                         typeof(TempDataWebSite.Controllers.HomeController.NonSerializableType).FullName + "' to session state.", exception.Message);
        }
        public async Task ApiController_JsonSettings()
        {
            // Arrange
            var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client = server.CreateClient();

            var expected =
                "{" + Environment.NewLine +
                "  \"Name\": \"Test User\"" + Environment.NewLine +
                "}";

            // Act
            var response = await client.GetAsync("http://localhost/api/Blog/ActionResult/GetJsonSettings");

            var content = await response.Content.ReadAsStringAsync();

            // Assert
            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            Assert.Equal(expected, content);
        }
Пример #19
0
        public async Task ProducesAttributeWithTypeOnly_RunsRegularContentNegotiation()
        {
            // Arrange
            var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client = server.CreateClient();

            client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            var expectedContentType = MediaTypeHeaderValue.Parse("application/json;charset=utf-8");
            var expectedOutput      = "{\"Name\":\"John\",\"Address\":\"One Microsoft Way\"}";

            // Act
            var response = await client.GetAsync("http://localhost/Home/UserInfo_ProducesWithTypeOnly");

            // Assert
            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            Assert.Equal(expectedContentType, response.Content.Headers.ContentType);
            var actual = await response.Content.ReadAsStringAsync();

            Assert.Equal(expectedOutput, actual);
        }
Пример #20
0
        public async Task ResponseCacheAttribute_OnAction_OverridesTheValuesOnClass()
        {
            // Arrange
            var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client = server.CreateClient();

            // Act
            var response = await client.GetAsync("http://localhost/ClassLevelNoStore/CacheThisActionWithProfileSettings");

            // Assert
            var data = Assert.Single(response.Headers.GetValues("Vary"));

            Assert.Equal("Accept", data);
            data = Assert.Single(response.Headers.GetValues("Cache-control"));
            Assert.Equal("public, max-age=30", data);
            IEnumerable <string> pragmaValues;

            response.Headers.TryGetValues("Pragma", out pragmaValues);
            Assert.Null(pragmaValues);
        }
        public async Task SwitchingFromNonInstrumentedToInstrumentedWorksForLayoutAndViewStarts()
        {
            // Arrange - 1
            var expectedLineMappings = new[]
            {
                Tuple.Create(92, 16, false),
                Tuple.Create(108, 1, true),
                Tuple.Create(0, 2, true),
                Tuple.Create(2, 8, true),
                Tuple.Create(10, 16, false),
                Tuple.Create(26, 1, true),
                Tuple.Create(27, 19, true),
                Tuple.Create(0, 6, true),
                Tuple.Create(7, 12, false),
                Tuple.Create(19, 1, true),
                Tuple.Create(21, 12, false),
                Tuple.Create(33, 7, true),
            };
            var context = new TestPageExecutionContext();
            var server  = TestHelper.CreateServer(_app, SiteName, services =>
            {
                services.AddInstance(context);
                _configureServices(services);
            });
            var client = server.CreateClient();

            // Act - 1
            var body = await client.GetStringAsync("http://localhost/Home/FullPath");

            // Assert - 1
            Assert.Empty(context.Values);

            // Arrange - 2
            client.DefaultRequestHeaders.Add("ENABLE-RAZOR-INSTRUMENTATION", "true");

            // Act - 2
            body = await client.GetStringAsync("http://localhost/Home/ViewDiscoveryPath");

            // Assert - 2
            Assert.Equal(expectedLineMappings, context.Values);
        }
Пример #22
0
        public async Task ApiExplorer_RouteTemplateStripsMultipleConstraints_InMultipleSegments()
        {
            // Arrange
            var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client = server.CreateClient();
            var url    = "http://localhost/ApiExplorerRouteAndPathParametersInformation/"
                         + "MultipleParametersInMultipleSegments/12/01/1987";

            var expectedRelativePath = "ApiExplorerRouteAndPathParametersInformation/"
                                       + "MultipleParametersInMultipleSegments/{month}/{day}/{year}";

            // Act
            var response = await client.GetAsync(url);

            var body = await response.Content.ReadAsStringAsync();

            var result = JsonConvert.DeserializeObject <List <ApiExplorerData> >(body);

            // Assert
            var description = Assert.Single(result);

            Assert.Equal(expectedRelativePath, description.RelativePath);

            var month = Assert.Single(description.ParameterDescriptions, p => p.Name == "month");

            Assert.False(month.RouteInfo.IsOptional);
            Assert.Equal("Path", month.Source);
            Assert.Equal("RangeRouteConstraint", Assert.Single(month.RouteInfo.ConstraintTypes));

            var day = Assert.Single(description.ParameterDescriptions, p => p.Name == "day");

            Assert.True(day.RouteInfo.IsOptional);
            Assert.Equal("ModelBinding", day.Source);
            Assert.Equal("IntRouteConstraint", Assert.Single(day.RouteInfo.ConstraintTypes));

            var year = Assert.Single(description.ParameterDescriptions, p => p.Name == "year");

            Assert.True(year.RouteInfo.IsOptional);
            Assert.Equal("ModelBinding", year.Source);
            Assert.Equal("IntRouteConstraint", Assert.Single(year.RouteInfo.ConstraintTypes));
        }
Пример #23
0
        public async Task FlushPointsAreExecutedForPagesWithComponentsPartialsAndSections(string action, string title)
        {
            var waitService = new WaitService();
            var server      = TestHelper.CreateServer(_app, SiteName,
                                                      services =>
            {
                _configureServices(services);
                services.AddInstance(waitService);
            });
            var client = server.CreateClient();

            // Act
            var stream = await client.GetStreamAsync("http://localhost/FlushPoint/" + action);

            // Assert - 1
            Assert.Equal(
                $@"<title>{ title }</title>
RenderBody content",
                GetTrimmedString(stream),
                ignoreLineEndingDifferences: true);
            waitService.WaitForServer();

            // Assert - 2
            Assert.Equal(
                @"partial-content

Value from TaskReturningString
<p>section-content</p>",
                GetTrimmedString(stream),
                ignoreLineEndingDifferences: true);
            waitService.WaitForServer();

            // Assert - 3
            Assert.Equal(
                @"component-content
    <span>Content that takes time to produce</span>

More content from layout",
                GetTrimmedString(stream),
                ignoreLineEndingDifferences: true);
        }
Пример #24
0
        public async Task MultipleAFTokensWithinTheSamePage_GeneratesASingleCookieToken()
        {
            // Arrange
            var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client = server.CreateClient();

            // Act
            var response = await client.GetAsync("http://localhost/Account/Login");

            //Assert
            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            var header = Assert.Single(response.Headers.GetValues("X-Frame-Options"));

            Assert.Equal("SAMEORIGIN", header);

            var setCookieHeader = response.Headers.GetValues("Set-Cookie").ToArray();

            // Even though there are two forms there should only be one response cookie,
            // as for the second form, the cookie from the first token should be reused.
            Assert.Single(setCookieHeader);
        }
        public async Task CanWrite_NonWrappedTypes(string url)
        {
            // Arrange
            var server  = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client  = server.CreateClient();
            var request = new HttpRequestMessage(HttpMethod.Get, url);

            request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml-xmlser"));

            // Act
            var response = await client.SendAsync(request);

            //Assert
            Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            var result = await response.Content.ReadAsStringAsync();

            XmlAssert.Equal("<ArrayOfString xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " +
                            "xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><string>value1</string>" +
                            "<string>value2</string></ArrayOfString>",
                            result);
        }
        public async Task ModelBinderAttribute_WithPrefixOnParameter()
        {
            // Arrange
            var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client = server.CreateClient();

            // [ModelBinder(Name = "customPrefix")] is used to apply a prefix
            var url =
                "http://localhost/ModelBinderAttribute_Product/GetBinderType_UseModelBinderOnType" +
                "?customPrefix.ProductId=5";

            // Act
            var response = await client.GetAsync(url);

            // Assert
            var body = await response.Content.ReadAsStringAsync();

            Assert.Equal(
                "ModelBindingWebSite.Controllers.ModelBinderAttribute_ProductController+ProductModelBinder",
                body);
        }
        public async Task ModelBinderAttribute_CustomModelPrefix_OnProperty()
        {
            // Arrange
            var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client = server.CreateClient();

            var url =
                "http://localhost/ModelBinderAttribute_Company/CreateCompany?employees[0].Alias=somealias";

            // Act
            var response = await client.GetAsync(url);

            // Assert
            var body = await response.Content.ReadAsStringAsync();

            var company = JsonConvert.DeserializeObject <Company>(body);

            var employee = Assert.Single(company.Employees);

            Assert.Equal("somealias", employee.EmailAlias);
        }
        public async Task FromQuery_CustomModelPrefix_ForCollectionParameter()
        {
            // Arrange
            var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client = server.CreateClient();

            var url =
                "http://localhost/FromQueryAttribute_Company/CreateCompanyFromEmployees?customPrefix[0].Name=somename";

            // Act
            var response = await client.GetAsync(url);

            // Assert
            var body = await response.Content.ReadAsStringAsync();

            var company = JsonConvert.DeserializeObject <Company>(body);

            var employee = Assert.Single(company.Employees);

            Assert.Equal("somename", employee.Name);
        }
        public async Task FromQuery_NonExistingValueAddsValidationErrors_OnProperty_UsingCustomModelPrefix()
        {
            // Arrange
            var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client = server.CreateClient();

            var url =
                "http://localhost/FromQueryAttribute_Company/ValidateDepartment?TestEmployees[0].Department=contoso";


            // Act
            var response = await client.GetAsync(url);

            // Assert
            var body = await response.Content.ReadAsStringAsync();

            var result = JsonConvert.DeserializeObject <Result>(body);
            var error  = Assert.Single(result.ModelStateErrors);

            Assert.Equal("TestEmployees[0].EmployeeId", error);
        }
Пример #30
0
        public async Task RoutingToANonExistantArea_WithoutExistConstraint_RoutesToIncorrectAction()
        {
            // Arrange
            var server = TestHelper.CreateServer(_app, SiteName, _configureServices);
            var client = server.CreateClient();

            // Act
            var response = await client.GetAsync("http://localhost/area-withoutexists/Users");

            // Assert
            var exception = response.GetServerException();

            // Mono issue - https://github.com/aspnet/External/issues/19
            Assert.Equal(
                "The view 'Index' was not found." +
                " The following locations were searched:" + PlatformNormalizer.GetNewLinesAsUnderscores(1) +
                "/Areas/Users/Views/Home/Index.cshtml" + PlatformNormalizer.GetNewLinesAsUnderscores(1) +
                "/Areas/Users/Views/Shared/Index.cshtml" + PlatformNormalizer.GetNewLinesAsUnderscores(1) +
                "/Views/Shared/Index.cshtml.",
                exception.ExceptionMessage);
        }