// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Net.Http; using System.Threading.Tasks; using Microsoft.AspNetCore.Testing; using Xunit; namespace Microsoft.AspNetCore.Mvc.FunctionalTests { public class HtmlHelperOptionsTest : IClassFixture> { public HtmlHelperOptionsTest(MvcTestFixture fixture) { Client = fixture.Client; } public HttpClient Client { get; } [Fact] public async Task AppWideDefaultsInViewAndPartialView() { // Arrange var expected = @"
MySummary
  • A model error occurred.
An error occurred.
MySummary
  • A model error occurred.
An error occurred.
False"; // Act var body = await Client.GetStringAsync("http://localhost/HtmlHelperOptions/HtmlHelperOptionsDefaultsInView"); // Assert Assert.Equal(expected, body.Trim(), ignoreLineEndingDifferences: true); } [Fact] [ReplaceCulture] public async Task OverrideAppWideDefaultsInViewAndPartialView() { // Arrange var expected = @"
MySummary
  • A model error occurred.
An error occurred.
True
MySummary
  • A model error occurred.
An error occurred.
True"; // Act var body = await Client.GetStringAsync("http://localhost/HtmlHelperOptions/OverrideAppWideDefaultsInView"); // Assert Assert.Equal(expected, body.Trim(), ignoreLineEndingDifferences: true); } } }