This commit is contained in:
Simon Cropp 2018-09-13 02:34:45 +10:00 committed by Pranav K
parent dfae9c208a
commit 43d4416a1d
35 changed files with 86 additions and 86 deletions

View File

@ -50,7 +50,7 @@ namespace Microsoft.AspNetCore.Mvc.Api.Analyzers
// if (!ModelState.IsValid) // if (!ModelState.IsValid)
// or // or
// if (ModelState.IsValid == false) // if (ModelState.IsValid == false)
// If the conditional is misisng a true condition or has an else expression, skip this operation. // If the conditional is missing a true condition or has an else expression, skip this operation.
return; return;
} }
@ -170,8 +170,8 @@ namespace Microsoft.AspNetCore.Mvc.Api.Analyzers
var constantValue = ((ILiteralOperation)operation).ConstantValue; var constantValue = ((ILiteralOperation)operation).ConstantValue;
if (!constantValue.HasValue || if (!constantValue.HasValue ||
!(constantValue.Value is bool boolCostantVaue) || !(constantValue.Value is bool boolConstantValue) ||
boolCostantVaue != expectedConstantValue) boolConstantValue != expectedConstantValue)
{ {
return false; return false;
} }
@ -199,7 +199,7 @@ namespace Microsoft.AspNetCore.Mvc.Api.Analyzers
if (propertyReference.Instance?.Kind != OperationKind.PropertyReference) if (propertyReference.Instance?.Kind != OperationKind.PropertyReference)
{ {
// Verify this is refering to the ModelState property on the current controller instance // Verify this is referring to the ModelState property on the current controller instance
return false; return false;
} }

View File

@ -16,20 +16,20 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Internal
private readonly IFileProvider _provider; private readonly IFileProvider _provider;
private readonly IHostingEnvironment _hostingEnvironment; private readonly IHostingEnvironment _hostingEnvironment;
public FileProviderRazorProjectFileSystem(IRazorViewEngineFileProviderAccessor accessor, IHostingEnvironment hostingEnviroment) public FileProviderRazorProjectFileSystem(IRazorViewEngineFileProviderAccessor accessor, IHostingEnvironment hostingEnvironment)
{ {
if (accessor == null) if (accessor == null)
{ {
throw new ArgumentNullException(nameof(accessor)); throw new ArgumentNullException(nameof(accessor));
} }
if (hostingEnviroment == null) if (hostingEnvironment == null)
{ {
throw new ArgumentNullException(nameof(hostingEnviroment)); throw new ArgumentNullException(nameof(hostingEnvironment));
} }
_provider = accessor.FileProvider; _provider = accessor.FileProvider;
_hostingEnvironment = hostingEnviroment; _hostingEnvironment = hostingEnvironment;
} }
public override RazorProjectItem GetItem(string path) public override RazorProjectItem GetItem(string path)

View File

@ -23,7 +23,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages
Subject = context.HandlerInstance; Subject = context.HandlerInstance;
var tempData = _tempDataFactory.GetTempData(context.HttpContext); var tempData = _tempDataFactory.GetTempData(context.HttpContext);
SetPropertyVaules(tempData); SetPropertyValues(tempData);
} }
public void OnPageHandlerExecuted(PageHandlerExecutedContext context) public void OnPageHandlerExecuted(PageHandlerExecutedContext context)

View File

@ -23,7 +23,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures
Subject = context.Controller; Subject = context.Controller;
var tempData = _tempDataFactory.GetTempData(context.HttpContext); var tempData = _tempDataFactory.GetTempData(context.HttpContext);
SetPropertyVaules(tempData); SetPropertyValues(tempData);
} }
} }
} }

View File

@ -61,7 +61,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures.Internal
/// Sets the values of the properties of <see cref="Subject"/> from <paramref name="tempData"/>. /// Sets the values of the properties of <see cref="Subject"/> from <paramref name="tempData"/>.
/// </summary> /// </summary>
/// <param name="tempData">The <see cref="ITempDataDictionary"/>.</param> /// <param name="tempData">The <see cref="ITempDataDictionary"/>.</param>
protected void SetPropertyVaules(ITempDataDictionary tempData) protected void SetPropertyValues(ITempDataDictionary tempData)
{ {
if (Properties == null) if (Properties == null)
{ {

View File

@ -1181,7 +1181,7 @@ namespace Microsoft.AspNetCore.Mvc.Description
} }
[Fact] [Fact]
public void GetApiDescription_ParameterDescription_IsRequiredNotSet_IfNotValiatingTopLevelNodes() public void GetApiDescription_ParameterDescription_IsRequiredNotSet_IfNotValidatingTopLevelNodes()
{ {
// Arrange // Arrange
var action = CreateActionDescriptor(nameof(RequiredParameter)); var action = CreateActionDescriptor(nameof(RequiredParameter));
@ -2081,7 +2081,7 @@ namespace Microsoft.AspNetCore.Mvc.Description
{ {
} }
private void AcceptsRedundantMetadata([FromQuery] RedundentMetadata r) private void AcceptsRedundantMetadata([FromQuery] RedundantMetadata r)
{ {
} }
@ -2247,7 +2247,7 @@ namespace Microsoft.AspNetCore.Mvc.Description
public string Name { get; set; } public string Name { get; set; }
} }
private class RedundentMetadata private class RedundantMetadata
{ {
[FromQuery] [FromQuery]
public int Id { get; set; } public int Id { get; set; }

View File

@ -78,7 +78,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters
[InlineData("application/*")] [InlineData("application/*")]
[InlineData("*/json")] [InlineData("*/json")]
[InlineData("*/*")] [InlineData("*/*")]
public void FormatterMappings_Wildcardformat(string format) public void FormatterMappings_WildcardFormat(string format)
{ {
// Arrange // Arrange
var options = new FormatterMappings(); var options = new FormatterMappings();

View File

@ -869,7 +869,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
} }
[Fact] [Fact]
public void CreateActionModel_AttributeRouteOnAction_CreatesOneActionInforPerRouteTemplate() public void CreateActionModel_AttributeRouteOnAction_CreatesOneActionInfoPerRouteTemplate()
{ {
// Arrange // Arrange
var builder = new TestApplicationModelProvider(); var builder = new TestApplicationModelProvider();
@ -951,7 +951,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
[Theory] [Theory]
[InlineData(typeof(SingleRouteAttributeController))] [InlineData(typeof(SingleRouteAttributeController))]
[InlineData(typeof(MultipleRouteAttributeController))] [InlineData(typeof(MultipleRouteAttributeController))]
public void CreateActionModel_RouteOnController_CreatesOneActionInforPerRouteTemplateOnAction(Type controller) public void CreateActionModel_RouteOnController_CreatesOneActionInfoPerRouteTemplateOnAction(Type controller)
{ {
// Arrange // Arrange
var builder = new TestApplicationModelProvider(); var builder = new TestApplicationModelProvider();

View File

@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
{ {
public abstract class FloatingPointTypeModelBinderTest<TFloatingPoint> where TFloatingPoint: struct public abstract class FloatingPointTypeModelBinderTest<TFloatingPoint> where TFloatingPoint: struct
{ {
public static TheoryData<Type> ConvertableTypeData public static TheoryData<Type> ConvertibleTypeData
{ {
get get
{ {
@ -32,7 +32,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
protected abstract TFloatingPoint ThirtyTwoThousandPointOne { get; } protected abstract TFloatingPoint ThirtyTwoThousandPointOne { get; }
[Theory] [Theory]
[MemberData(nameof(ConvertableTypeData))] [MemberData(nameof(ConvertibleTypeData))]
public async Task BindModel_ReturnsFailure_IfAttemptedValueCannotBeParsed(Type destinationType) public async Task BindModel_ReturnsFailure_IfAttemptedValueCannotBeParsed(Type destinationType)
{ {
// Arrange // Arrange
@ -51,7 +51,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
} }
[Theory] [Theory]
[MemberData(nameof(ConvertableTypeData))] [MemberData(nameof(ConvertibleTypeData))]
public async Task BindModel_CreatesError_IfAttemptedValueCannotBeParsed(Type destinationType) public async Task BindModel_CreatesError_IfAttemptedValueCannotBeParsed(Type destinationType)
{ {
// Arrange // Arrange
@ -76,7 +76,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
} }
[Theory] [Theory]
[MemberData(nameof(ConvertableTypeData))] [MemberData(nameof(ConvertibleTypeData))]
public async Task BindModel_CreatesError_IfAttemptedValueCannotBeCompletelyParsed(Type destinationType) public async Task BindModel_CreatesError_IfAttemptedValueCannotBeCompletelyParsed(Type destinationType)
{ {
// Arrange // Arrange
@ -100,7 +100,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
} }
[Theory] [Theory]
[MemberData(nameof(ConvertableTypeData))] [MemberData(nameof(ConvertibleTypeData))]
public async Task BindModel_CreatesError_IfAttemptedValueContainsDisallowedWhitespace(Type destinationType) public async Task BindModel_CreatesError_IfAttemptedValueContainsDisallowedWhitespace(Type destinationType)
{ {
// Arrange // Arrange
@ -124,7 +124,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
} }
[Theory] [Theory]
[MemberData(nameof(ConvertableTypeData))] [MemberData(nameof(ConvertibleTypeData))]
public async Task BindModel_CreatesError_IfAttemptedValueContainsDisallowedDecimal(Type destinationType) public async Task BindModel_CreatesError_IfAttemptedValueContainsDisallowedDecimal(Type destinationType)
{ {
// Arrange // Arrange
@ -148,7 +148,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
} }
[Theory] [Theory]
[MemberData(nameof(ConvertableTypeData))] [MemberData(nameof(ConvertibleTypeData))]
public async Task BindModel_CreatesError_IfAttemptedValueContainsDisallowedThousandsSeparator(Type destinationType) public async Task BindModel_CreatesError_IfAttemptedValueContainsDisallowedThousandsSeparator(Type destinationType)
{ {
// Arrange // Arrange
@ -172,7 +172,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
} }
[Theory] [Theory]
[MemberData(nameof(ConvertableTypeData))] [MemberData(nameof(ConvertibleTypeData))]
public async Task BindModel_ReturnsFailed_IfValueProviderEmpty(Type destinationType) public async Task BindModel_ReturnsFailed_IfValueProviderEmpty(Type destinationType)
{ {
// Arrange // Arrange
@ -236,7 +236,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
} }
[Theory] [Theory]
[MemberData(nameof(ConvertableTypeData))] [MemberData(nameof(ConvertibleTypeData))]
public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid_Twelve(Type destinationType) public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid_Twelve(Type destinationType)
{ {
// Arrange // Arrange
@ -257,7 +257,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
} }
[Theory] [Theory]
[MemberData(nameof(ConvertableTypeData))] [MemberData(nameof(ConvertibleTypeData))]
[ReplaceCulture("en-GB", "en-GB")] [ReplaceCulture("en-GB", "en-GB")]
public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid_TwelvePointFive(Type destinationType) public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid_TwelvePointFive(Type destinationType)
{ {
@ -279,7 +279,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
} }
[Theory] [Theory]
[MemberData(nameof(ConvertableTypeData))] [MemberData(nameof(ConvertibleTypeData))]
public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid_FrenchTwelvePointFive(Type destinationType) public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid_FrenchTwelvePointFive(Type destinationType)
{ {
// Arrange // Arrange
@ -300,7 +300,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
} }
[Theory] [Theory]
[MemberData(nameof(ConvertableTypeData))] [MemberData(nameof(ConvertibleTypeData))]
public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid_ThirtyTwoThousand(Type destinationType) public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid_ThirtyTwoThousand(Type destinationType)
{ {
// Arrange // Arrange
@ -321,7 +321,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
} }
[Theory] [Theory]
[MemberData(nameof(ConvertableTypeData))] [MemberData(nameof(ConvertibleTypeData))]
public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid_ThirtyTwoThousandPointOne(Type destinationType) public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid_ThirtyTwoThousandPointOne(Type destinationType)
{ {
// Arrange // Arrange
@ -342,7 +342,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
} }
[Theory] [Theory]
[MemberData(nameof(ConvertableTypeData))] [MemberData(nameof(ConvertibleTypeData))]
public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid_FrenchThirtyTwoThousandPointOne(Type destinationType) public async Task BindModel_ReturnsModel_IfAttemptedValueIsValid_FrenchThirtyTwoThousandPointOne(Type destinationType)
{ {
// Arrange // Arrange

View File

@ -66,7 +66,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
Assert.True(bindingContext.ModelState.ContainsKey("theModelName")); Assert.True(bindingContext.ModelState.ContainsKey("theModelName"));
} }
public static TheoryData<Type> ConvertableTypeData public static TheoryData<Type> ConvertibleTypeData
{ {
get get
{ {
@ -92,7 +92,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
} }
[Theory] [Theory]
[MemberData(nameof(ConvertableTypeData))] [MemberData(nameof(ConvertibleTypeData))]
public async Task BindModel_ReturnsFailure_IfTypeCanBeConverted_AndConversionFails(Type destinationType) public async Task BindModel_ReturnsFailure_IfTypeCanBeConverted_AndConversionFails(Type destinationType)
{ {
// Arrange // Arrange
@ -112,7 +112,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
} }
[Theory] [Theory]
[MemberData(nameof(ConvertableTypeData))] [MemberData(nameof(ConvertibleTypeData))]
public async Task BindModel_CreatesError_WhenTypeConversionIsNull(Type destinationType) public async Task BindModel_CreatesError_WhenTypeConversionIsNull(Type destinationType)
{ {
// Arrange // Arrange

View File

@ -262,7 +262,7 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
} }
public static TheoryData<string, IEnumerable<string>, IEnumerable<ModelValidationResult>> public static TheoryData<string, IEnumerable<string>, IEnumerable<ModelValidationResult>>
Valdate_ReturnsExpectedResults_Data Validate_ReturnsExpectedResults_Data
{ {
get get
{ {
@ -327,8 +327,8 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
} }
[Theory] [Theory]
[MemberData(nameof(Valdate_ReturnsExpectedResults_Data))] [MemberData(nameof(Validate_ReturnsExpectedResults_Data))]
public void Valdate_ReturnsExpectedResults( public void Validate_ReturnsExpectedResults(
string errorMessage, string errorMessage,
IEnumerable<string> memberNames, IEnumerable<string> memberNames,
IEnumerable<ModelValidationResult> expectedResults) IEnumerable<ModelValidationResult> expectedResults)

View File

@ -39,16 +39,16 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
adapter.GetErrorMessage(validationContext); adapter.GetErrorMessage(validationContext);
// Assert // Assert
Assert.True(attribute.Formated); Assert.True(attribute.Formatted);
} }
public class TestValidationAttribute : ValidationAttribute public class TestValidationAttribute : ValidationAttribute
{ {
public bool Formated = false; public bool Formatted = false;
public override string FormatErrorMessage(string name) public override string FormatErrorMessage(string name)
{ {
Formated = true; Formatted = true;
return base.FormatErrorMessage(name); return base.FormatErrorMessage(name);
} }
} }

View File

@ -30,7 +30,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Json.Internal
var context = GetActionContext(); var context = GetActionContext();
var result = new JsonResult(new { foo = "abcd" }); var result = new JsonResult(new { foo = "abcd" });
var executor = CreateExcutor(); var executor = CreateExecutor();
// Act // Act
await executor.ExecuteAsync(context, result); await executor.ExecuteAsync(context, result);
@ -51,7 +51,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Json.Internal
var result = new JsonResult(new { foo = "abcd" }); var result = new JsonResult(new { foo = "abcd" });
result.ContentType = "text/json"; result.ContentType = "text/json";
var executor = CreateExcutor(); var executor = CreateExecutor();
// Act // Act
await executor.ExecuteAsync(context, result); await executor.ExecuteAsync(context, result);
@ -75,7 +75,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Json.Internal
{ {
Encoding = Encoding.ASCII Encoding = Encoding.ASCII
}.ToString(); }.ToString();
var executor = CreateExcutor(); var executor = CreateExecutor();
// Act // Act
await executor.ExecuteAsync(context, result); await executor.ExecuteAsync(context, result);
@ -97,7 +97,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Json.Internal
context.HttpContext.Response.ContentType = expectedContentType; context.HttpContext.Response.ContentType = expectedContentType;
var result = new JsonResult(new { foo = "abcd" }); var result = new JsonResult(new { foo = "abcd" });
var executor = CreateExcutor(); var executor = CreateExecutor();
// Act // Act
await executor.ExecuteAsync(context, result); await executor.ExecuteAsync(context, result);
@ -122,7 +122,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Json.Internal
context.HttpContext.Response.ContentType = responseContentType; context.HttpContext.Response.ContentType = responseContentType;
var result = new JsonResult(new { foo = "abcd" }); var result = new JsonResult(new { foo = "abcd" });
var executor = CreateExcutor(); var executor = CreateExecutor();
// Act // Act
await executor.ExecuteAsync(context, result); await executor.ExecuteAsync(context, result);
@ -147,7 +147,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Json.Internal
serializerSettings.Formatting = Formatting.Indented; serializerSettings.Formatting = Formatting.Indented;
var result = new JsonResult(new { foo = "abcd" }, serializerSettings); var result = new JsonResult(new { foo = "abcd" }, serializerSettings);
var executor = CreateExcutor(); var executor = CreateExecutor();
// Act // Act
await executor.ExecuteAsync(context, result); await executor.ExecuteAsync(context, result);
@ -165,7 +165,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Json.Internal
var expected = Encoding.UTF8.GetBytes("{\"name\":\"Robert\""); var expected = Encoding.UTF8.GetBytes("{\"name\":\"Robert\"");
var context = GetActionContext(); var context = GetActionContext();
var result = new JsonResult(new ModelWithSerializationError()); var result = new JsonResult(new ModelWithSerializationError());
var executor = CreateExcutor(); var executor = CreateExecutor();
// Act // Act
try try
@ -190,7 +190,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Json.Internal
var expected = "Executing JsonResult, writing value of type 'System.String'."; var expected = "Executing JsonResult, writing value of type 'System.String'.";
var context = GetActionContext(); var context = GetActionContext();
var logger = new StubLogger(); var logger = new StubLogger();
var executer = CreateExcutor(logger); var executer = CreateExecutor(logger);
var result = new JsonResult("result_value"); var result = new JsonResult("result_value");
// Act // Act
@ -207,7 +207,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Json.Internal
var expected = "Executing JsonResult, writing value of type 'null'."; var expected = "Executing JsonResult, writing value of type 'null'.";
var context = GetActionContext(); var context = GetActionContext();
var logger = new StubLogger(); var logger = new StubLogger();
var executer = CreateExcutor(logger); var executer = CreateExecutor(logger);
var result = new JsonResult(null); var result = new JsonResult(null);
// Act // Act
@ -217,7 +217,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Json.Internal
Assert.Equal(expected, logger.MostRecentMessage); Assert.Equal(expected, logger.MostRecentMessage);
} }
private static JsonResultExecutor CreateExcutor(ILogger<JsonResultExecutor> logger = null) private static JsonResultExecutor CreateExecutor(ILogger<JsonResultExecutor> logger = null)
{ {
return new JsonResultExecutor( return new JsonResultExecutor(
new TestHttpResponseStreamWriterFactory(), new TestHttpResponseStreamWriterFactory(),

View File

@ -29,7 +29,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
public async Task ApiExplorer_IsVisible_EnabledWithConvention() public async Task ApiExplorer_IsVisible_EnabledWithConvention()
{ {
// Arrange & Act // Arrange & Act
var response = await Client.GetAsync("http://localhost/ApiExplorerVisbilityEnabledByConvention"); var response = await Client.GetAsync("http://localhost/ApiExplorerVisibilityEnabledByConvention");
var body = await response.Content.ReadAsStringAsync(); var body = await response.Content.ReadAsStringAsync();
var result = JsonConvert.DeserializeObject<List<ApiExplorerData>>(body); var result = JsonConvert.DeserializeObject<List<ApiExplorerData>>(body);
@ -42,7 +42,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
public async Task ApiExplorer_IsVisible_DisabledWithConvention() public async Task ApiExplorer_IsVisible_DisabledWithConvention()
{ {
// Arrange & Act // Arrange & Act
var response = await Client.GetAsync("http://localhost/ApiExplorerVisbilityDisabledByConvention"); var response = await Client.GetAsync("http://localhost/ApiExplorerVisibilityDisabledByConvention");
var body = await response.Content.ReadAsStringAsync(); var body = await response.Content.ReadAsStringAsync();
var result = JsonConvert.DeserializeObject<List<ApiExplorerData>>(body); var result = JsonConvert.DeserializeObject<List<ApiExplorerData>>(body);

View File

@ -107,7 +107,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
[ConditionalFact] [ConditionalFact]
// Mono issue - https://github.com/aspnet/External/issues/18 // Mono issue - https://github.com/aspnet/External/issues/18
[FrameworkSkipCondition(RuntimeFrameworks.Mono)] [FrameworkSkipCondition(RuntimeFrameworks.Mono)]
public async Task DerivedClassLevelAttribute_OveridesBaseClassLevel() public async Task DerivedClassLevelAttribute_OverridesBaseClassLevel()
{ {
// Arrange // Arrange
var input = "<Product xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" " + var input = "<Product xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\" " +

View File

@ -18,7 +18,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
public HttpClient Client { get; } public HttpClient Client { get; }
[Fact] [Fact]
public async Task Controller_WithDefaultValueAttribut_ReturnsDefault() public async Task Controller_WithDefaultValueAttribute_ReturnsDefault()
{ {
// Arrange // Arrange
var expected = "hello"; var expected = "hello";

View File

@ -287,7 +287,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
{ {
// Act // Act
var input = "Test"; var input = "Test";
var response = await Client.PostAsJsonAsync("PolymorhpicPropertyBinding/Action", input); var response = await Client.PostAsJsonAsync("PolymorphicPropertyBinding/Action", input);
// Assert // Assert
await response.AssertStatusCodeAsync(HttpStatusCode.OK); await response.AssertStatusCodeAsync(HttpStatusCode.OK);
@ -299,7 +299,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
public async Task ValidationUsesModelMetadataFromActualModelType_ForInputFormattedProperties() public async Task ValidationUsesModelMetadataFromActualModelType_ForInputFormattedProperties()
{ {
// Act // Act
var response = await Client.PostAsJsonAsync("PolymorhpicPropertyBinding/Action", string.Empty); var response = await Client.PostAsJsonAsync("PolymorphicPropertyBinding/Action", string.Empty);
// Assert // Assert
await response.AssertStatusCodeAsync(HttpStatusCode.BadRequest); await response.AssertStatusCodeAsync(HttpStatusCode.BadRequest);

View File

@ -95,7 +95,7 @@
<link href="HtmlEncode[[/styles/site.min.css]]" rel="stylesheet" data-extra="test" /> <link href="HtmlEncode[[/styles/site.min.css]]" rel="stylesheet" data-extra="test" />
<meta name="x-stylesheet-fallback-test" content="" class="HtmlEncode[[hidden]]" /><script>!function(a,b,c,d){var e,f=document,g=f.getElementsByTagName("SCRIPT"),h=g[g.length-1].previousElementSibling,i=f.defaultView&&f.defaultView.getComputedStyle?f.defaultView.getComputedStyle(h):h.currentStyle;if(i&&i[a]!==b)for(e=0;e<c.length;e++)f.write('<link href="'+c[e]+'" '+d+"/>")}("JavaScriptEncode[[visibility]]","JavaScriptEncode[[hidden]]",["JavaScriptEncode[[HtmlEncode[[/styles/site.css]]]]","JavaScriptEncode[[HtmlEncode[[/styles/siteIntegrity.css]]]]","JavaScriptEncode[[HtmlEncode[[/styles/sub/site2.css]]]]"], "JavaScriptEncode[[rel="stylesheet" data-extra="test" ]]");</script> <meta name="x-stylesheet-fallback-test" content="" class="HtmlEncode[[hidden]]" /><script>!function(a,b,c,d){var e,f=document,g=f.getElementsByTagName("SCRIPT"),h=g[g.length-1].previousElementSibling,i=f.defaultView&&f.defaultView.getComputedStyle?f.defaultView.getComputedStyle(h):h.currentStyle;if(i&&i[a]!==b)for(e=0;e<c.length;e++)f.write('<link href="'+c[e]+'" '+d+"/>")}("JavaScriptEncode[[visibility]]","JavaScriptEncode[[hidden]]",["JavaScriptEncode[[HtmlEncode[[/styles/site.css]]]]","JavaScriptEncode[[HtmlEncode[[/styles/siteIntegrity.css]]]]","JavaScriptEncode[[HtmlEncode[[/styles/sub/site2.css]]]]"], "JavaScriptEncode[[rel="stylesheet" data-extra="test" ]]");</script>
<!-- Fallback from globbed href to glbobed href --> <!-- Fallback from globbed href to globbed href -->
<meta name="x-stylesheet-fallback-test" content="" class="HtmlEncode[[hidden]]" /><script>!function(a,b,c,d){var e,f=document,g=f.getElementsByTagName("SCRIPT"),h=g[g.length-1].previousElementSibling,i=f.defaultView&&f.defaultView.getComputedStyle?f.defaultView.getComputedStyle(h):h.currentStyle;if(i&&i[a]!==b)for(e=0;e<c.length;e++)f.write('<link href="'+c[e]+'" '+d+"/>")}("JavaScriptEncode[[visibility]]","JavaScriptEncode[[hidden]]",["JavaScriptEncode[[HtmlEncode[[/styles/site.css]]]]"], "JavaScriptEncode[[rel="stylesheet" data-extra="test" ]]");</script> <meta name="x-stylesheet-fallback-test" content="" class="HtmlEncode[[hidden]]" /><script>!function(a,b,c,d){var e,f=document,g=f.getElementsByTagName("SCRIPT"),h=g[g.length-1].previousElementSibling,i=f.defaultView&&f.defaultView.getComputedStyle?f.defaultView.getComputedStyle(h):h.currentStyle;if(i&&i[a]!==b)for(e=0;e<c.length;e++)f.write('<link href="'+c[e]+'" '+d+"/>")}("JavaScriptEncode[[visibility]]","JavaScriptEncode[[hidden]]",["JavaScriptEncode[[HtmlEncode[[/styles/site.css]]]]"], "JavaScriptEncode[[rel="stylesheet" data-extra="test" ]]");</script>

View File

@ -96,7 +96,7 @@
<link href="/styles/site.min.css" rel="stylesheet" data-extra="test" /> <link href="/styles/site.min.css" rel="stylesheet" data-extra="test" />
<meta name="x-stylesheet-fallback-test" content="" class="hidden" /><script>!function(a,b,c,d){var e,f=document,g=f.getElementsByTagName("SCRIPT"),h=g[g.length-1].previousElementSibling,i=f.defaultView&&f.defaultView.getComputedStyle?f.defaultView.getComputedStyle(h):h.currentStyle;if(i&&i[a]!==b)for(e=0;e<c.length;e++)f.write('<link href="'+c[e]+'" '+d+"/>")}("visibility","hidden",["\/styles\/site.css","\/styles\/siteIntegrity.css","\/styles\/sub\/site2.css"], "rel=\u0022stylesheet\u0022 data-extra=\u0022test\u0022 ");</script> <meta name="x-stylesheet-fallback-test" content="" class="hidden" /><script>!function(a,b,c,d){var e,f=document,g=f.getElementsByTagName("SCRIPT"),h=g[g.length-1].previousElementSibling,i=f.defaultView&&f.defaultView.getComputedStyle?f.defaultView.getComputedStyle(h):h.currentStyle;if(i&&i[a]!==b)for(e=0;e<c.length;e++)f.write('<link href="'+c[e]+'" '+d+"/>")}("visibility","hidden",["\/styles\/site.css","\/styles\/siteIntegrity.css","\/styles\/sub\/site2.css"], "rel=\u0022stylesheet\u0022 data-extra=\u0022test\u0022 ");</script>
<!-- Fallback from globbed href to glbobed href --> <!-- Fallback from globbed href to globbed href -->
<meta name="x-stylesheet-fallback-test" content="" class="hidden" /><script>!function(a,b,c,d){var e,f=document,g=f.getElementsByTagName("SCRIPT"),h=g[g.length-1].previousElementSibling,i=f.defaultView&&f.defaultView.getComputedStyle?f.defaultView.getComputedStyle(h):h.currentStyle;if(i&&i[a]!==b)for(e=0;e<c.length;e++)f.write('<link href="'+c[e]+'" '+d+"/>")}("visibility","hidden",["\/styles\/site.css"], "rel=\u0022stylesheet\u0022 data-extra=\u0022test\u0022 ");</script> <meta name="x-stylesheet-fallback-test" content="" class="hidden" /><script>!function(a,b,c,d){var e,f=document,g=f.getElementsByTagName("SCRIPT"),h=g[g.length-1].previousElementSibling,i=f.defaultView&&f.defaultView.getComputedStyle?f.defaultView.getComputedStyle(h):h.currentStyle;if(i&&i[a]!==b)for(e=0;e<c.length;e++)f.write('<link href="'+c[e]+'" '+d+"/>")}("visibility","hidden",["\/styles\/site.css"], "rel=\u0022stylesheet\u0022 data-extra=\u0022test\u0022 ");</script>

View File

@ -2659,7 +2659,7 @@ namespace Microsoft.AspNetCore.Mvc.IntegrationTests
// This covers the case where a key is present, but has an empty value. The type converter // This covers the case where a key is present, but has an empty value. The type converter
// will report an error. // will report an error.
[Fact] [Fact]
public async Task MutableObjectModelBinder_BindsPOCO_TypeConvertedPropertyNonConvertableValue_GetsError() public async Task MutableObjectModelBinder_BindsPOCO_TypeConvertedPropertyNonConvertibleValue_GetsError()
{ {
// Arrange // Arrange
var parameter = new ParameterDescriptor() var parameter = new ParameterDescriptor()

View File

@ -241,7 +241,7 @@ namespace Microsoft.AspNetCore.Mvc.IntegrationTests
} }
[Fact] [Fact]
public async Task BindParameter_NonConvertableValue_GetsError() public async Task BindParameter_NonConvertibleValue_GetsError()
{ {
// Arrange // Arrange
var parameterBinder = ModelBindingTestHelper.GetParameterBinder(); var parameterBinder = ModelBindingTestHelper.GetParameterBinder();
@ -290,7 +290,7 @@ namespace Microsoft.AspNetCore.Mvc.IntegrationTests
} }
[Fact] [Fact]
public async Task BindParameter_NonConvertableValue_GetsCustomErrorMessage() public async Task BindParameter_NonConvertibleValue_GetsCustomErrorMessage()
{ {
// Arrange // Arrange
var parameterType = typeof(int); var parameterType = typeof(int);

View File

@ -110,7 +110,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Internal
private class TestPageWithDerivedModel : Page private class TestPageWithDerivedModel : Page
{ {
public DeriviedModel Model => null; public DerivedModel Model => null;
public override Task ExecuteAsync() =>throw new NotImplementedException(); public override Task ExecuteAsync() =>throw new NotImplementedException();
} }
@ -121,7 +121,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Internal
} }
[Authorize(Policy = "Derived")] [Authorize(Policy = "Derived")]
private class DeriviedModel : BaseModel private class DerivedModel : BaseModel
{ {
public virtual void OnGet() public virtual void OnGet()
{ {

View File

@ -361,7 +361,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
} }
[Fact] [Fact]
public async Task ProcessAsync_DoesNotUseModelFromViewdata_IfModelExpressionEvalulatesToNull() public async Task ProcessAsync_DoesNotUseModelFromViewdata_IfModelExpressionEvaluatesToNull()
{ {
// Arrange // Arrange
var bufferScope = new TestViewBufferScope(); var bufferScope = new TestViewBufferScope();
@ -455,7 +455,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
} }
[Fact] [Fact]
public async Task ProcessAsync_UsesModelOnViewContextViewData_WhenModelExpresionIsNull() public async Task ProcessAsync_UsesModelOnViewContextViewData_WhenModelExpressionIsNull()
{ {
// Arrange // Arrange
var bufferScope = new TestViewBufferScope(); var bufferScope = new TestViewBufferScope();

View File

@ -98,7 +98,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
[Theory] [Theory]
[MemberData(nameof(ProcessAsync_GeneratesExpectedOutput_WithNoErrorsData))] [MemberData(nameof(ProcessAsync_GeneratesExpectedOutput_WithNoErrorsData))]
public async Task ProcessAsync_SuppressesOutput_IfClientSideValiationDisabled_WithNoErrorsData( public async Task ProcessAsync_SuppressesOutput_IfClientSideValidationDisabled_WithNoErrorsData(
ModelStateDictionary modelStateDictionary) ModelStateDictionary modelStateDictionary)
{ {
// Arrange // Arrange

View File

@ -143,7 +143,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures.Internal
} }
[Fact] [Fact]
public void ObjectTemplate_HonoursHideSurroundingHtml() public void ObjectTemplate_HonorsHideSurroundingHtml()
{ {
// Arrange // Arrange
var expected = var expected =
@ -231,7 +231,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures.Internal
} }
[Fact] [Fact]
public void HiddenInputTemplate_HonoursHideSurroundingHtml() public void HiddenInputTemplate_HonorsHideSurroundingHtml()
{ {
// Arrange // Arrange
var model = "Model string"; var model = "Model string";

View File

@ -374,7 +374,7 @@ Environment.NewLine;
} }
[Fact] [Fact]
public void ObjectTemplate_HonoursHideSurroundingHtml() public void ObjectTemplate_HonorsHideSurroundingHtml()
{ {
// Arrange // Arrange
var expected = var expected =
@ -470,7 +470,7 @@ Environment.NewLine;
} }
[Fact] [Fact]
public void HiddenInputTemplate_HonoursHideSurroundingHtml() public void HiddenInputTemplate_HonorsHideSurroundingHtml()
{ {
// Arrange // Arrange
var expected = "<input id=\"HtmlEncode[[FieldPrefix]]\" name=\"HtmlEncode[[FieldPrefix]]\" type=\"HtmlEncode[[hidden]]\" value=\"HtmlEncode[[Model string]]\" />"; var expected = "<input id=\"HtmlEncode[[FieldPrefix]]\" name=\"HtmlEncode[[FieldPrefix]]\" type=\"HtmlEncode[[hidden]]\" value=\"HtmlEncode[[Model string]]\" />";

View File

@ -54,7 +54,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures.Internal
Assert.Collection( Assert.Collection(
result.OrderBy(p => p.Key), result.OrderBy(p => p.Key),
property => Assert.Equal(nameof(BaseController.BaseProperty), property.PropertyInfo.Name), property => Assert.Equal(nameof(BaseController.BaseProperty), property.PropertyInfo.Name),
property => Assert.Equal(nameof(DerivedController.DeriviedProperty), property.PropertyInfo.Name)); property => Assert.Equal(nameof(DerivedController.DerivedProperty), property.PropertyInfo.Name));
} }
[Fact] [Fact]
@ -90,7 +90,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures.Internal
public class DerivedController : BaseController public class DerivedController : BaseController
{ {
[ViewData] [ViewData]
public string DeriviedProperty { get; set; } public string DerivedProperty { get; set; }
} }
public class PropertyWithKeyController public class PropertyWithKeyController

View File

@ -34,10 +34,10 @@ namespace Microsoft.AspNetCore.Mvc.Analyzers
public async Task GetAttributes_OnNonOverriddenMethod_ReturnsAllAttributesOnCurrentAction() public async Task GetAttributes_OnNonOverriddenMethod_ReturnsAllAttributesOnCurrentAction()
{ {
// Arrange // Arrange
var compilation = await GetCompilation("GetAttributes_WithoutMethodOverridding"); var compilation = await GetCompilation("GetAttributes_WithoutMethodOverriding");
var attribute = compilation.GetTypeByMetadataName(typeof(ProducesResponseTypeAttribute).FullName); var attribute = compilation.GetTypeByMetadataName(typeof(ProducesResponseTypeAttribute).FullName);
var testClass = compilation.GetTypeByMetadataName($"{Namespace}.{nameof(GetAttributes_WithoutMethodOverridding)}"); var testClass = compilation.GetTypeByMetadataName($"{Namespace}.{nameof(GetAttributes_WithoutMethodOverriding)}");
var method = (IMethodSymbol)testClass.GetMembers(nameof(GetAttributes_WithoutMethodOverridding.Method)).First(); var method = (IMethodSymbol)testClass.GetMembers(nameof(GetAttributes_WithoutMethodOverriding.Method)).First();
// Act // Act
var attributes = CodeAnalysisExtensions.GetAttributes(method, attribute, inherit: true); var attributes = CodeAnalysisExtensions.GetAttributes(method, attribute, inherit: true);

View File

@ -1,6 +1,6 @@
namespace Microsoft.AspNetCore.Mvc.Analyzers namespace Microsoft.AspNetCore.Mvc.Analyzers
{ {
public class GetAttributes_WithoutMethodOverridding public class GetAttributes_WithoutMethodOverriding
{ {
[ProducesResponseType(201)] [ProducesResponseType(201)]
public void Method() { } public void Method() { }

View File

@ -5,8 +5,8 @@ using Microsoft.AspNetCore.Mvc;
namespace ApiExplorerWebSite namespace ApiExplorerWebSite
{ {
[Route("ApiExplorerVisbilityDisabledByConvention")] [Route("ApiExplorerVisibilityDisabledByConvention")]
public class ApiExplorerVisbilityDisabledByConventionController : Controller public class ApiExplorerVisibilityDisabledByConventionController : Controller
{ {
[HttpGet] [HttpGet]
public void Get() public void Get()

View File

@ -5,8 +5,8 @@ using Microsoft.AspNetCore.Mvc;
namespace ApiExplorerWebSite namespace ApiExplorerWebSite
{ {
[Route("ApiExplorerVisbilityEnabledByConvention")] [Route("ApiExplorerVisibilityEnabledByConvention")]
public class ApiExplorerVisbilityEnabledByConventionController : Controller public class ApiExplorerVisibilityEnabledByConventionController : Controller
{ {
[HttpGet] [HttpGet]
public void Get() public void Get()

View File

@ -28,7 +28,7 @@ namespace ApiExplorerWebSite
options.Conventions.Add(new ApiExplorerVisibilityEnabledConvention()); options.Conventions.Add(new ApiExplorerVisibilityEnabledConvention());
options.Conventions.Add(new ApiExplorerVisibilityDisabledConvention( options.Conventions.Add(new ApiExplorerVisibilityDisabledConvention(
typeof(ApiExplorerVisbilityDisabledByConventionController))); typeof(ApiExplorerVisibilityDisabledByConventionController)));
options.Conventions.Add(new ApiExplorerInboundOutboundConvention( options.Conventions.Add(new ApiExplorerInboundOutboundConvention(
typeof(ApiExplorerInboundOutBoundController))); typeof(ApiExplorerInboundOutBoundController)));
options.Conventions.Add(new ApiExplorerRouteChangeConvention(wellKnownChangeToken)); options.Conventions.Add(new ApiExplorerRouteChangeConvention(wellKnownChangeToken));

View File

@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Mvc;
namespace FormatterWebSite.Controllers namespace FormatterWebSite.Controllers
{ {
public class PolymorhpicPropertyBindingController : ControllerBase public class PolymorphicPropertyBindingController : ControllerBase
{ {
[FromBody] [FromBody]
public IModel Person { get; set; } public IModel Person { get; set; }

View File

@ -157,7 +157,7 @@
asp-fallback-test-property="visibility" asp-fallback-test-property="visibility"
asp-fallback-test-value="hidden" /> asp-fallback-test-value="hidden" />
<!-- Fallback from globbed href to glbobed href --> <!-- Fallback from globbed href to globbed href -->
<link asp-href-include="styles/site.min.css" rel="stylesheet" data-extra="test" <link asp-href-include="styles/site.min.css" rel="stylesheet" data-extra="test"
asp-fallback-href-include="**/site.css" asp-fallback-href-include="**/site.css"
asp-fallback-test-class="hidden" asp-fallback-test-class="hidden"