Fix some spelling (#8378)
This commit is contained in:
parent
c0f3a46ffe
commit
b156dee4f1
|
|
@ -105,7 +105,7 @@ namespace Microsoft.AspNetCore.Mvc.Performance
|
|||
|
||||
var state = routeContext.RouteData.PushState(MockRouter.Instance, routeValues, null);
|
||||
|
||||
var actual = NaiveSelectCandiates(_actions, routeContext.RouteData.Values);
|
||||
var actual = NaiveSelectCandidates(_actions, routeContext.RouteData.Values);
|
||||
Verify(expected, actual);
|
||||
|
||||
state.Restore();
|
||||
|
|
@ -113,7 +113,7 @@ namespace Microsoft.AspNetCore.Mvc.Performance
|
|||
}
|
||||
|
||||
// A naive implementation we can use to generate match data for inputs, and for a baseline.
|
||||
private static IReadOnlyList<ActionDescriptor> NaiveSelectCandiates(ActionDescriptor[] actions, RouteValueDictionary routeValues)
|
||||
private static IReadOnlyList<ActionDescriptor> NaiveSelectCandidates(ActionDescriptor[] actions, RouteValueDictionary routeValues)
|
||||
{
|
||||
var results = new List<ActionDescriptor>();
|
||||
for (var i = 0; i < actions.Length; i++)
|
||||
|
|
@ -175,7 +175,7 @@ namespace Microsoft.AspNetCore.Mvc.Performance
|
|||
{
|
||||
var action = actions[i];
|
||||
var routeValues = new RouteValueDictionary(action.RouteValues);
|
||||
var matches = NaiveSelectCandiates(actions, routeValues);
|
||||
var matches = NaiveSelectCandidates(actions, routeValues);
|
||||
if (matches.Count == 0)
|
||||
{
|
||||
throw new InvalidOperationException("This should have at least one match.");
|
||||
|
|
@ -193,7 +193,7 @@ namespace Microsoft.AspNetCore.Mvc.Performance
|
|||
// Make one of the route values not match.
|
||||
routeValues[routeValues.First().Key] = ((string)routeValues.First().Value) + "fkdkfdkkf";
|
||||
|
||||
var matches = NaiveSelectCandiates(actions, routeValues);
|
||||
var matches = NaiveSelectCandidates(actions, routeValues);
|
||||
if (matches.Count != 0)
|
||||
{
|
||||
throw new InvalidOperationException("This should have 0 matches.");
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Intializes a new instance of <see cref="ActionResult{TValue}"/> using the specified <see cref="ActionResult"/>.
|
||||
/// Initializes a new instance of <see cref="ActionResult{TValue}"/> using the specified <see cref="ActionResult"/>.
|
||||
/// </summary>
|
||||
/// <param name="result">The <see cref="ActionResult"/>.</param>
|
||||
public ActionResult(ActionResult result)
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
}
|
||||
else if (methods.Length > 1)
|
||||
{
|
||||
throw new ArgumentException(Resources.FormatApiConventionMethod_AmbigiousMethodName(methodName, conventionType), nameof(methodName));
|
||||
throw new ArgumentException(Resources.FormatApiConventionMethod_AmbiguousMethodName(methodName, conventionType), nameof(methodName));
|
||||
}
|
||||
|
||||
return methods[0];
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationParts
|
|||
/// Gets the list of <see cref="ApplicationPart"/> instances.
|
||||
/// <para>
|
||||
/// Instances in this collection are stored in precedence order. An <see cref="ApplicationPart"/> that appears
|
||||
/// earlier in the list has a higher precendence.
|
||||
/// earlier in the list has a higher precedence.
|
||||
/// An <see cref="IApplicationFeatureProvider"/> may choose to use this an interface as a way to resolve conflicts when
|
||||
/// multiple <see cref="ApplicationPart"/> instances resolve equivalent feature values.
|
||||
/// </para>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// </summary>
|
||||
/// <remarks>
|
||||
/// By default, this maps to <see cref="ProblemDetails.Title"/> and should not change
|
||||
/// between multiple occurences of the same error.
|
||||
/// between multiple occurrences of the same error.
|
||||
/// </remarks>
|
||||
public string Title { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@ using Microsoft.Extensions.DependencyInjection;
|
|||
namespace Microsoft.AspNetCore.Mvc
|
||||
{
|
||||
/// <summary>
|
||||
/// Specifies the version compatibility of runtime behaviors configured by <see cref="MvcOptions"/>.
|
||||
/// Specifies the version compatibility of runtime behaviors configured by <see cref="MvcOptions"/>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// The best way to set a compatibility version is by using
|
||||
/// The best way to set a compatibility version is by using
|
||||
/// <see cref="MvcCoreMvcBuilderExtensions.SetCompatibilityVersion"/> or
|
||||
/// <see cref="MvcCoreMvcCoreBuilderExtensions.SetCompatibilityVersion"/> in your application's
|
||||
/// <c>ConfigureServices</c> method.
|
||||
|
|
@ -20,32 +20,32 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// public class Startup
|
||||
/// {
|
||||
/// ...
|
||||
///
|
||||
///
|
||||
/// public void ConfigureServices(IServiceCollection services)
|
||||
/// {
|
||||
/// services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
|
||||
/// }
|
||||
///
|
||||
///
|
||||
/// ...
|
||||
/// }
|
||||
/// </code>
|
||||
/// </example>
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Setting compatiblity version to a specific version will change the default values of various
|
||||
/// settings to match a particular minor release of ASP.NET Core MVC.
|
||||
/// Setting compatibility version to a specific version will change the default values of various
|
||||
/// settings to match a particular minor release of ASP.NET Core MVC.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public enum CompatibilityVersion
|
||||
{
|
||||
/// <summary>
|
||||
/// Sets the default value of settings on <see cref="MvcOptions"/> to match the behavior of
|
||||
/// Sets the default value of settings on <see cref="MvcOptions"/> to match the behavior of
|
||||
/// ASP.NET Core MVC 2.0.
|
||||
/// </summary>
|
||||
Version_2_0,
|
||||
|
||||
/// <summary>
|
||||
/// Sets the default value of settings on <see cref="MvcOptions"/> to match the behavior of
|
||||
/// Sets the default value of settings on <see cref="MvcOptions"/> to match the behavior of
|
||||
/// ASP.NET Core MVC 2.1.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
// If there are multiple IConsumeActionConstraints which are defined at the class and
|
||||
// at the action level, the one closest to the action overrides the others. To ensure this
|
||||
// we take advantage of the fact that ConsumesAttribute is both an IActionFilter and an
|
||||
// IConsumeActionConstraint. Since filterdescriptor collection is ordered (the last filter is the one
|
||||
// IConsumeActionConstraint. Since FilterDescriptor collection is ordered (the last filter is the one
|
||||
// closest to the action), we apply this constraint only if there is no IConsumeActionConstraint after this.
|
||||
return actionDescriptor.FilterDescriptors.Last(
|
||||
filter => filter.Filter is IConsumesActionConstraint).Filter == this;
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
///
|
||||
/// <code>
|
||||
/// [HttpGet]
|
||||
/// public ProductModel GetProduct([FromServices] IProductModelRequestService productModelReqest)
|
||||
/// public ProductModel GetProduct([FromServices] IProductModelRequestService productModelRequest)
|
||||
/// {
|
||||
/// return productModelReqest.Value;
|
||||
/// return productModelRequest.Value;
|
||||
/// }
|
||||
/// </code>
|
||||
/// </example>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ using Microsoft.Extensions.Options;
|
|||
namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
||||
{
|
||||
/// <summary>
|
||||
/// A base class for infrastructure that implements ASP.NET Core MVC's support for
|
||||
/// A base class for infrastructure that implements ASP.NET Core MVC's support for
|
||||
/// <see cref="CompatibilityVersion"/>. This is framework infrastructure and should not be used
|
||||
/// by application code.
|
||||
/// </summary>
|
||||
|
|
@ -61,7 +61,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
|||
throw new ArgumentNullException(nameof(options));
|
||||
}
|
||||
|
||||
// Evaluate DefaultValues onces so subclasses don't have to cache.
|
||||
// Evaluate DefaultValues once so subclasses don't have to cache.
|
||||
var defaultValues = DefaultValues;
|
||||
|
||||
foreach (var @switch in options)
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
|||
|
||||
return new CompositeChangeToken(changeTokens);
|
||||
}
|
||||
|
||||
|
||||
private void Initialize()
|
||||
{
|
||||
// Using double-checked locking on initialization because we fire change token callbacks
|
||||
|
|
@ -134,7 +134,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
|||
// Consumers who poll will observe a new action descriptor collection at step 2 - they will see
|
||||
// the new collection and ignore the change token.
|
||||
//
|
||||
// Consumers who listen to the change token will requery at step 4 - they will see the new collection
|
||||
// Consumers who listen to the change token will re-query at step 4 - they will see the new collection
|
||||
// and new change token.
|
||||
//
|
||||
// Anyone who acquires the collection and change token between steps 2 and 3 will be notified of
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
|||
///</para>
|
||||
///<para>
|
||||
/// To be reactively notified of changes, downcast to <see cref="ActionDescriptorCollectionProvider"/> and
|
||||
/// subcribe to the change token returned from <see cref="ActionDescriptorCollectionProvider.GetChangeToken"/>
|
||||
/// subscribe to the change token returned from <see cref="ActionDescriptorCollectionProvider.GetChangeToken"/>
|
||||
/// using <see cref="ChangeToken.OnChange(System.Func{IChangeToken}, System.Action)"/>.
|
||||
/// </para>
|
||||
/// <para>
|
||||
|
|
|
|||
|
|
@ -12,14 +12,14 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
|||
/// </summary>
|
||||
/// <typeparam name="TResult">The type of <see cref="IActionResult"/>.</typeparam>
|
||||
/// <remarks>
|
||||
/// Implementions of <see cref="IActionResultExecutor{TResult}"/> are typically called by the
|
||||
/// Implementations of <see cref="IActionResultExecutor{TResult}"/> are typically called by the
|
||||
/// <see cref="IActionResult.ExecuteResultAsync(ActionContext)"/> method of the corresponding action result type.
|
||||
/// Implementations should be registered as singleton services.
|
||||
/// </remarks>
|
||||
public interface IActionResultExecutor<in TResult> where TResult : IActionResult
|
||||
{
|
||||
/// <summary>
|
||||
/// Asynchronously excecutes the action result, by modifying the <see cref="HttpResponse"/>.
|
||||
/// Asynchronously executes the action result, by modifying the <see cref="HttpResponse"/>.
|
||||
/// </summary>
|
||||
/// <param name="context">The <see cref="ActionContext"/> associated with the current request."/></param>
|
||||
/// <param name="result">The action result to execute.</param>
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
=> typeof(Task<IActionResult>).IsAssignableFrom(executor.MethodReturnType);
|
||||
}
|
||||
|
||||
// Task<PhysicalfileResult> DownloadFile(..)
|
||||
// Task<PhysicalFileResult> DownloadFile(..)
|
||||
// ValueTask<ViewResult> GetViewsAsync(..)
|
||||
private class TaskOfActionResultExecutor : ActionMethodExecutor
|
||||
{
|
||||
|
|
|
|||
|
|
@ -365,7 +365,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
|
||||
// We also want to add the same (as in reference equality) list of actions to the ordinal entries.
|
||||
// We'll keep updating `entries` to include all of the actions in the same equivalence class -
|
||||
// meaning, all conventionally routed actions for which the route values are equalignoring case.
|
||||
// meaning, all conventionally routed actions for which the route values are equal ignoring case.
|
||||
//
|
||||
// `entries` will appear in `OrdinalIgnoreCaseEntries` exactly once and in `OrdinalEntries` once
|
||||
// for each variation of casing that we've seen.
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
|
||||
public RequestDelegate GetPipeline(Type configurationType)
|
||||
{
|
||||
// Build the pipeline only once. This is similar to how middlewares registered in Startup are constructed.
|
||||
// Build the pipeline only once. This is similar to how middleware registered in Startup are constructed.
|
||||
|
||||
var requestDelegate = _pipelinesCache.GetOrAdd(
|
||||
configurationType,
|
||||
|
|
@ -77,7 +77,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
}
|
||||
|
||||
// Ideally we want the experience of a middleware pipeline to behave the same as if it was registered
|
||||
// in Startup. In this scenario, an Exception thrown in a middelware later in the pipeline gets
|
||||
// in Startup. In this scenario, an Exception thrown in a middleware later in the pipeline gets
|
||||
// propagated back to earlier middleware. So, check if a later resource filter threw an Exception and
|
||||
// propagate that back to the middleware pipeline.
|
||||
resourceExecutedContext.ExceptionDispatchInfo?.Throw();
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
private readonly DefaultHttpContext _httpContextInstance;
|
||||
|
||||
// The following are protected by this lock for WRITES only. This pattern is similar
|
||||
// to DefaultActionDescriptorChangeProvider - see comments there for details on
|
||||
// to DefaultActionDescriptorChangeProvider - see comments there for details on
|
||||
// all of the threading behaviors.
|
||||
private readonly object _lock = new object();
|
||||
private List<Endpoint> _endpoints;
|
||||
|
|
@ -162,7 +162,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
// - /Home/Index/{id?}
|
||||
// - /Home
|
||||
// - /
|
||||
if (UseDefaultValuePlusRemainingSegementsOptional(i, action, endpointInfo, newPathSegments))
|
||||
if (UseDefaultValuePlusRemainingSegmentsOptional(i, action, endpointInfo, newPathSegments))
|
||||
{
|
||||
var subPathSegments = newPathSegments.Take(i);
|
||||
|
||||
|
|
@ -270,7 +270,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
}
|
||||
}
|
||||
|
||||
private bool UseDefaultValuePlusRemainingSegementsOptional(
|
||||
private bool UseDefaultValuePlusRemainingSegmentsOptional(
|
||||
int segmentIndex,
|
||||
ActionDescriptor action,
|
||||
MvcEndpointInfo endpointInfo,
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
|
|||
}
|
||||
|
||||
// If the model type is IEnumerable<> then we need to know if we can assign a List<> to it, since
|
||||
// that's what we would create. (The cases handled here are IEnumerable<>, IReadOnlyColection<> and
|
||||
// that's what we would create. (The cases handled here are IEnumerable<>, IReadOnlyCollection<> and
|
||||
// IReadOnlyList<>).
|
||||
var enumerableType = ClosedGenericMatcher.ExtractGenericInterface(modelType, typeof(IEnumerable<>));
|
||||
if (enumerableType != null)
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
|
|||
//
|
||||
// If a property does not have a binding source, then it's fair game for any value provider.
|
||||
//
|
||||
// If any property meets the above conditions and has a value from valueproviders, then we'll
|
||||
// If any property meets the above conditions and has a value from ValueProviders, then we'll
|
||||
// create the model and try to bind it. OR if ALL properties of the model have a greedy source,
|
||||
// then we go ahead and create it.
|
||||
//
|
||||
|
|
|
|||
|
|
@ -82,11 +82,11 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
|
|||
// enum FlagsEnum { Value1 = 1, Value2 = 2, Value4 = 4 }
|
||||
//
|
||||
// Valid Scenarios:
|
||||
// 1. valueproviderresult="Value2,Value4", model=Value2 | Value4, underlying=6, converted=Value2, Value4
|
||||
// 2. valueproviderresult="2,4", model=Value2 | Value4, underlying=6, converted=Value2, Value4
|
||||
// 1. valueProviderResult="Value2,Value4", model=Value2 | Value4, underlying=6, converted=Value2, Value4
|
||||
// 2. valueProviderResult="2,4", model=Value2 | Value4, underlying=6, converted=Value2, Value4
|
||||
//
|
||||
// Invalid Scenarios:
|
||||
// 1. valueproviderresult="2,10", model=12, underlying=12, converted=12
|
||||
// 1. valueProviderResult="2,10", model=12, underlying=12, converted=12
|
||||
//
|
||||
var underlying = Convert.ChangeType(
|
||||
model,
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
|
|||
var headerName = bindingContext.FieldName;
|
||||
|
||||
// Do not set ModelBindingResult to Failed on not finding the value in the header as we want the inner
|
||||
// modelbinder to do that. This would give a chance to the inner binder to add more useful information.
|
||||
// ModelBinder to do that. This would give a chance to the inner binder to add more useful information.
|
||||
// For example, SimpleTypeModelBinder adds a model error when binding to let's say an integer and the
|
||||
// model is null.
|
||||
var request = bindingContext.HttpContext.Request;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ using Microsoft.Extensions.Primitives;
|
|||
|
||||
namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
||||
{
|
||||
// Normalizes keys, in a keyvaluepair collection, from jQuery format to a format that MVC understands.
|
||||
// Normalizes keys, in a KeyValuePair collection, from jQuery format to a format that MVC understands.
|
||||
internal static class JQueryKeyValuePairNormalizer
|
||||
{
|
||||
public static IDictionary<string, StringValues> GetValues(
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata
|
|||
var cacheEntry = GetCacheEntry(modelType);
|
||||
|
||||
// We're relying on a safe race-condition for Properties - take care only
|
||||
// to set the value onces the properties are fully-initialized.
|
||||
// to set the value once the properties are fully-initialized.
|
||||
if (cacheEntry.Details.Properties == null)
|
||||
{
|
||||
var key = ModelMetadataIdentity.ForType(modelType);
|
||||
|
|
|
|||
|
|
@ -1509,18 +1509,18 @@ namespace Microsoft.AspNetCore.Mvc.Core
|
|||
=> string.Format(CultureInfo.CurrentCulture, GetString("ApiConvention_UnsupportedAttributesOnConvention"), p0, p1, p2);
|
||||
|
||||
/// <summary>
|
||||
/// Method name '{0}' is ambigous for convention type '{1}'. More than one method found with the name '{0}'.
|
||||
/// Method name '{0}' is ambiguous for convention type '{1}'. More than one method found with the name '{0}'.
|
||||
/// </summary>
|
||||
internal static string ApiConventionMethod_AmbigiousMethodName
|
||||
internal static string ApiConventionMethod_AmbiguousMethodName
|
||||
{
|
||||
get => GetString("ApiConventionMethod_AmbigiousMethodName");
|
||||
get => GetString("ApiConventionMethod_AmbiguousMethodName");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Method name '{0}' is ambigous for convention type '{1}'. More than one method found with the name '{0}'.
|
||||
/// Method name '{0}' is ambiguous for convention type '{1}'. More than one method found with the name '{0}'.
|
||||
/// </summary>
|
||||
internal static string FormatApiConventionMethod_AmbigiousMethodName(object p0, object p1)
|
||||
=> string.Format(CultureInfo.CurrentCulture, GetString("ApiConventionMethod_AmbigiousMethodName"), p0, p1);
|
||||
internal static string FormatApiConventionMethod_AmbiguousMethodName(object p0, object p1)
|
||||
=> string.Format(CultureInfo.CurrentCulture, GetString("ApiConventionMethod_AmbiguousMethodName"), p0, p1);
|
||||
|
||||
/// <summary>
|
||||
/// A method named '{0}' was not found on convention type '{1}'.
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
|
|
@ -26,36 +26,36 @@
|
|||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
|
|
@ -451,8 +451,8 @@
|
|||
<data name="ApiConvention_UnsupportedAttributesOnConvention" xml:space="preserve">
|
||||
<value>Method {0} is decorated with the following attributes that are not allowed on an API convention method:{1}The following attributes are allowed on API convention methods: {2}.</value>
|
||||
</data>
|
||||
<data name="ApiConventionMethod_AmbigiousMethodName" xml:space="preserve">
|
||||
<value>Method name '{0}' is ambigous for convention type '{1}'. More than one method found with the name '{0}'.</value>
|
||||
<data name="ApiConventionMethod_AmbiguousMethodName" xml:space="preserve">
|
||||
<value>Method name '{0}' is ambiguous for convention type '{1}'. More than one method found with the name '{0}'.</value>
|
||||
</data>
|
||||
<data name="ApiConventionMethod_NoMethodFound" xml:space="preserve">
|
||||
<value>A method named '{0}' was not found on convention type '{1}'.</value>
|
||||
|
|
|
|||
|
|
@ -462,7 +462,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
if (!routeValues.ContainsKey("handler") &&
|
||||
ambientValues.TryGetValue("handler", out var handler))
|
||||
{
|
||||
// Clear out formaction unless it's explicitly specified in the routeValues.
|
||||
// Clear out form action unless it's explicitly specified in the routeValues.
|
||||
routeValues["handler"] = null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
public class ValidationProblemDetails : ProblemDetails
|
||||
{
|
||||
/// <summary>
|
||||
/// Intializes a new instance of <see cref="ValidationProblemDetails"/>.
|
||||
/// Initializes a new instance of <see cref="ValidationProblemDetails"/>.
|
||||
/// </summary>
|
||||
public ValidationProblemDetails()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a flag to determine whether error messsages from JSON deserialization by the
|
||||
/// Gets or sets a flag to determine whether error messages from JSON deserialization by the
|
||||
/// <see cref="JsonInputFormatter"/> will be added to the <see cref="ModelStateDictionary"/>. The default
|
||||
/// value is <c>false</c>, meaning that a generic error message will be used instead.
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -25,12 +25,12 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationParts
|
|||
|
||||
if (duplicates != null)
|
||||
{
|
||||
var viewsDiffereningInCase = string.Join(Environment.NewLine, duplicates.Select(d => d.Identifier));
|
||||
var viewsDifferingInCase = string.Join(Environment.NewLine, duplicates.Select(d => d.Identifier));
|
||||
|
||||
var message = string.Join(
|
||||
Environment.NewLine,
|
||||
Resources.RazorViewCompiler_ViewPathsDifferOnlyInCase,
|
||||
viewsDiffereningInCase);
|
||||
viewsDifferingInCase);
|
||||
throw new InvalidOperationException(message);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,12 +35,12 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Compilation
|
|||
{
|
||||
// Ensure parts do not specify views with differing cases. This is not supported
|
||||
// at runtime and we should flag at as such for precompiled views.
|
||||
var viewsDiffereningInCase = string.Join(Environment.NewLine, duplicates.Select(d => d.RelativePath));
|
||||
var viewsDifferingInCase = string.Join(Environment.NewLine, duplicates.Select(d => d.RelativePath));
|
||||
|
||||
var message = string.Join(
|
||||
Environment.NewLine,
|
||||
Resources.RazorViewCompiler_ViewPathsDifferOnlyInCase,
|
||||
viewsDiffereningInCase);
|
||||
viewsDifferingInCase);
|
||||
throw new InvalidOperationException(message);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||
// ViewFeature items have precedence semantics - when two views have the same path \ identifier,
|
||||
// the one that appears earlier in the list wins. Therefore the ordering of
|
||||
// RazorCompiledItemFeatureProvider and ViewsFeatureProvider is pertinent - any view compiled
|
||||
// using the Sdk will be prefered to views compiled using MvcPrecompilation.
|
||||
// using the Sdk will be preferred to views compiled using MvcPrecompilation.
|
||||
if (!builder.PartManager.FeatureProviders.OfType<RazorCompiledItemFeatureProvider>().Any())
|
||||
{
|
||||
builder.PartManager.FeatureProviders.Add(new RazorCompiledItemFeatureProvider());
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Internal
|
|||
// from either the set of known precompiled views, or by being compiled.
|
||||
_cache = cache;
|
||||
|
||||
// We need to validate that the all of the precompiled views are unique by path (case-insenstive).
|
||||
// We need to validate that the all of the precompiled views are unique by path (case-insensitive).
|
||||
// We do this because there's no good way to canonicalize paths on windows, and it will create
|
||||
// problems when deploying to linux. Rather than deal with these issues, we just don't support
|
||||
// views that differ only by case.
|
||||
|
|
@ -293,7 +293,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Internal
|
|||
_logger.ViewCompilerCouldNotFindFileAtPath(normalizedPath);
|
||||
|
||||
// If the file doesn't exist, we can't do compilation right now - we still want to cache
|
||||
// the fact that we tried. This will allow us to retrigger compilation if the view file
|
||||
// the fact that we tried. This will allow us to re-trigger compilation if the view file
|
||||
// is added.
|
||||
return new ViewCompilerWorkItem()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Internal
|
|||
|
||||
public void OnProvidersExecuting(PageRouteModelProviderContext context)
|
||||
{
|
||||
// When RootDirectory and AreaRootDirectory overlap, e.g. RootDirectory = /, AreaRootDirectoryy = /Areas;
|
||||
// When RootDirectory and AreaRootDirectory overlap, e.g. RootDirectory = /, AreaRootDirectory = /Areas;
|
||||
// we need to ensure that the page is only route-able via the area route. By adding area routes first,
|
||||
// we'll ensure non area routes get skipped when it encounters an IsAlreadyRegistered check.
|
||||
|
||||
|
|
@ -128,7 +128,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Internal
|
|||
|
||||
private static bool IsRouteable(RazorProjectItem item)
|
||||
{
|
||||
// Pages like _ViewImports should not be routable.
|
||||
// Pages like _ViewImports should not be routeable.
|
||||
return !item.FileName.StartsWith("_", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers.Cache
|
|||
public class CacheTagKey : IEquatable<CacheTagKey>
|
||||
{
|
||||
private static readonly char[] AttributeSeparator = new[] { ',' };
|
||||
private static readonly Func<IRequestCookieCollection, string, string> CookieAcccessor = (c, key) => c[key];
|
||||
private static readonly Func<IRequestCookieCollection, string, string> CookieAccessor = (c, key) => c[key];
|
||||
private static readonly Func<IHeaderDictionary, string, string> HeaderAccessor = (c, key) => c[key];
|
||||
private static readonly Func<IQueryCollection, string, string> QueryAccessor = (c, key) => c[key];
|
||||
private static readonly Func<RouteValueDictionary, string, string> RouteValueAccessor = (c, key) => c[key]?.ToString();
|
||||
|
|
@ -87,7 +87,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers.Cache
|
|||
_expiresOn = tagHelper.ExpiresOn;
|
||||
_expiresSliding = tagHelper.ExpiresSliding;
|
||||
_varyBy = tagHelper.VaryBy;
|
||||
_cookies = ExtractCollection(tagHelper.VaryByCookie, request.Cookies, CookieAcccessor);
|
||||
_cookies = ExtractCollection(tagHelper.VaryByCookie, request.Cookies, CookieAccessor);
|
||||
_headers = ExtractCollection(tagHelper.VaryByHeader, request.Headers, HeaderAccessor);
|
||||
_queries = ExtractCollection(tagHelper.VaryByQuery, request.Query, QueryAccessor);
|
||||
_routeValues = ExtractCollection(tagHelper.VaryByRoute, tagHelper.ViewContext.RouteData.Values, RouteValueAccessor);
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
|
|||
// can't be put inside a using block.
|
||||
entry.Dispose();
|
||||
|
||||
// Set the result on the TCS once we've commited the entry to the cache since commiting to the cache
|
||||
// Set the result on the TCS once we've committed the entry to the cache since commiting to the cache
|
||||
// may throw.
|
||||
tcs.SetResult(content);
|
||||
return content;
|
||||
|
|
|
|||
|
|
@ -167,9 +167,9 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <remarks>Does nothing if user provides an <c>formaction</c> attribute.</remarks>
|
||||
/// <remarks>Does nothing if user provides an <c>FormAction</c> attribute.</remarks>
|
||||
/// <exception cref="InvalidOperationException">
|
||||
/// Thrown if <c>formaction</c> attribute is provided and <see cref="Action"/>, <see cref="Controller"/>,
|
||||
/// Thrown if <c>FormAction</c> attribute is provided and <see cref="Action"/>, <see cref="Controller"/>,
|
||||
/// <see cref="Fragment"/> or <see cref="Route"/> are non-<c>null</c> or if the user provided <c>asp-route-*</c> attributes.
|
||||
/// Also thrown if <see cref="Route"/> and one or both of <see cref="Action"/> and <see cref="Controller"/>
|
||||
/// are non-<c>null</c>
|
||||
|
|
@ -186,7 +186,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
|
|||
throw new ArgumentNullException(nameof(output));
|
||||
}
|
||||
|
||||
// If "formaction" is already set, it means the user is attempting to use a normal button or input element.
|
||||
// If "FormAction" is already set, it means the user is attempting to use a normal button or input element.
|
||||
if (output.Attributes.ContainsName(FormAction))
|
||||
{
|
||||
if (Action != null ||
|
||||
|
|
@ -198,7 +198,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
|
|||
Route != null ||
|
||||
(_routeValues != null && _routeValues.Count > 0))
|
||||
{
|
||||
// User specified a formaction and one of the bound attributes; can't override that formaction
|
||||
// User specified a FormAction and one of the bound attributes; can't override that FormAction
|
||||
// attribute.
|
||||
throw new InvalidOperationException(
|
||||
Resources.FormatFormActionTagHelper_CannotOverrideFormAction(
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
|
|||
public class RenderAtEndOfFormTagHelper : TagHelper
|
||||
{
|
||||
// This TagHelper's order must be greater than the FormTagHelper's. I.e it must be executed after
|
||||
// FormTaghelper does.
|
||||
// FormTagHelper does.
|
||||
/// <inheritdoc />
|
||||
public override int Order => -900;
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
|
|||
var copiedAttribute = false;
|
||||
|
||||
// We iterate context.AllAttributes backwards since we prioritize TagHelperOutput values occurring
|
||||
// before the current context.AllAttribtes[i].
|
||||
// before the current context.AllAttributes[i].
|
||||
for (var i = context.AllAttributes.Count - 1; i >= 0; i--)
|
||||
{
|
||||
// We look for the original attribute so we can restore the exact attribute name the user typed in
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ namespace Microsoft.AspNetCore.Mvc.Testing.Handlers
|
|||
/// <summary>
|
||||
/// Creates a new instance of <see cref="RedirectHandler"/>.
|
||||
/// </summary>
|
||||
/// <param name="maxRedirects">The maximun number of redirect responses to follow. It must be
|
||||
/// <param name="maxRedirects">The maximum number of redirect responses to follow. It must be
|
||||
/// equal or greater than 0.</param>
|
||||
public RedirectHandler(int maxRedirects)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ namespace Microsoft.AspNetCore.Mvc.Testing
|
|||
/// <see cref="WebApplicationFactoryContentRootAttribute"/> on the assembly containing the functional tests with
|
||||
/// a key equal to the <typeparamref name="TEntryPoint"/> assembly <see cref="Assembly.FullName"/>.
|
||||
/// In case an attribute with the right key can't be found, <see cref="WebApplicationFactory{TEntryPoint}"/>
|
||||
/// will fall back to searching for a solution file (*.sln) and then appending <typeparamref name="TEntryPoint"/> asembly name
|
||||
/// will fall back to searching for a solution file (*.sln) and then appending <typeparamref name="TEntryPoint"/> assembly name
|
||||
/// to the solution directory. The application root directory will be used to discover views and content files.
|
||||
/// </para>
|
||||
/// <para>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
/// Gets or sets <see cref="ViewDataDictionary"/> used by <see cref="ViewResult"/> and <see cref="ViewBag"/>.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// By default, this property is intiailized when <see cref="Controllers.IControllerActivator"/> activates
|
||||
/// By default, this property is initialized when <see cref="Controllers.IControllerActivator"/> activates
|
||||
/// controllers.
|
||||
/// <para>
|
||||
/// This property can be accessed after the controller has been activated, for example, in a controller action
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures.Internal
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
// Very common trival method; nudge it to inline https://github.com/aspnet/Mvc/pull/8339
|
||||
// Very common trivial method; nudge it to inline https://github.com/aspnet/Mvc/pull/8339
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public IHtmlContentBuilder Append(string unencoded)
|
||||
{
|
||||
|
|
@ -106,7 +106,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures.Internal
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
// Very common trival method; nudge it to inline https://github.com/aspnet/Mvc/pull/8339
|
||||
// Very common trivial method; nudge it to inline https://github.com/aspnet/Mvc/pull/8339
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public IHtmlContentBuilder AppendHtml(IHtmlContent content)
|
||||
{
|
||||
|
|
@ -119,7 +119,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures.Internal
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
// Very common trival method; nudge it to inline https://github.com/aspnet/Mvc/pull/8339
|
||||
// Very common trivial method; nudge it to inline https://github.com/aspnet/Mvc/pull/8339
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public IHtmlContentBuilder AppendHtml(string encoded)
|
||||
{
|
||||
|
|
@ -131,7 +131,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures.Internal
|
|||
return this;
|
||||
}
|
||||
|
||||
// Very common trival method; nudge it to inline https://github.com/aspnet/Mvc/pull/8339
|
||||
// Very common trivial method; nudge it to inline https://github.com/aspnet/Mvc/pull/8339
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private void AppendValue(ViewBufferValue value)
|
||||
{
|
||||
|
|
@ -139,7 +139,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures.Internal
|
|||
page.Append(value);
|
||||
}
|
||||
|
||||
// Very common trival method; nudge it to inline https://github.com/aspnet/Mvc/pull/8339
|
||||
// Very common trivial method; nudge it to inline https://github.com/aspnet/Mvc/pull/8339
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private ViewBufferPage GetCurrentPage()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures.Internal
|
|||
|
||||
public bool IsFull => Count == Capacity;
|
||||
|
||||
// Very common trival method; nudge it to inline https://github.com/aspnet/Mvc/pull/8339
|
||||
// Very common trivial method; nudge it to inline https://github.com/aspnet/Mvc/pull/8339
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public void Append(ViewBufferValue value) => Buffer[Count++] = value;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,13 +16,13 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures
|
|||
{
|
||||
public SaveTempDataAttribute()
|
||||
{
|
||||
// Since SaveTempDataFilter registers for a response's OnStarting callback, we want this filter to run
|
||||
// as early as possible to get the opportunity to register the call back before any other result filter
|
||||
// Since SaveTempDataFilter registers for a response's OnStarting callback, we want this filter to run
|
||||
// as early as possible to get the opportunity to register the call back before any other result filter
|
||||
// starts writing to the response stream.
|
||||
Order = int.MinValue + 100;
|
||||
}
|
||||
|
||||
// <inheritdoc />
|
||||
/// <inheritdoc />
|
||||
public int Order { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
|
|
|
|||
|
|
@ -1565,10 +1565,10 @@ namespace Microsoft.AspNetCore.Mvc.Description
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void GetApiDescription_ParameterDescription_RedundentMetadata_NotMergedWithParent()
|
||||
public void GetApiDescription_ParameterDescription_RedundantMetadata_NotMergedWithParent()
|
||||
{
|
||||
// Arrange
|
||||
var action = CreateActionDescriptor(nameof(AcceptsRedundentMetadata));
|
||||
var action = CreateActionDescriptor(nameof(AcceptsRedundantMetadata));
|
||||
var parameterDescriptor = action.Parameters.Single();
|
||||
|
||||
// Act
|
||||
|
|
@ -1590,7 +1590,7 @@ namespace Microsoft.AspNetCore.Mvc.Description
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void GetApiDescription_ParameterDescription_RedundentMetadata_WithParameterMetadata()
|
||||
public void GetApiDescription_ParameterDescription_RedundantMetadata_WithParameterMetadata()
|
||||
{
|
||||
// Arrange
|
||||
var action = CreateActionDescriptor(nameof(AcceptsPerson));
|
||||
|
|
@ -2081,7 +2081,7 @@ namespace Microsoft.AspNetCore.Mvc.Description
|
|||
{
|
||||
}
|
||||
|
||||
private void AcceptsRedundentMetadata([FromQuery] RedundentMetadata r)
|
||||
private void AcceptsRedundantMetadata([FromQuery] RedundentMetadata r)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void OnFormatting_NullUrlHelperContextNoRequestServices_ThrowsArgumentNullExeption()
|
||||
public void OnFormatting_NullUrlHelperContextNoRequestServices_ThrowsArgumentNullException()
|
||||
{
|
||||
// Arrange
|
||||
var context = new ActionContext(new DefaultHttpContext(), new RouteData(), new ActionDescriptor());
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
public void Convert_InfersDeclaredTypeFromActionResultTypeParameter()
|
||||
{
|
||||
// Arrange
|
||||
var value = new DeriviedItem();
|
||||
var value = new DerivedItem();
|
||||
var actionResultOfT = new ActionResult<BaseItem>(value);
|
||||
var convertToActionResult = (IConvertToActionResult)actionResultOfT;
|
||||
|
||||
|
|
@ -85,7 +85,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
{
|
||||
}
|
||||
|
||||
private class DeriviedItem : BaseItem
|
||||
private class DerivedItem : BaseItem
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,14 +85,14 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void Constructor_ThrowsIfMethodIsAmbigous()
|
||||
public void Constructor_ThrowsIfMethodIsAmbiguous()
|
||||
{
|
||||
// Arrange
|
||||
var methodName = typeof(ConventionWithProducesAttribute).FullName + '.' + nameof(ConventionWithProducesAttribute.Get);
|
||||
var attribute = typeof(ProducesAttribute);
|
||||
var type = typeof(TestConventions);
|
||||
|
||||
var expected = $"Method name 'Method' is ambigous for convention type '{type}'. More than one method found with the name 'Method'.";
|
||||
var expected = $"Method name 'Method' is ambiguous for convention type '{type}'. More than one method found with the name 'Method'.";
|
||||
|
||||
// Act & Assert
|
||||
ExceptionAssert.ThrowsArgument(
|
||||
|
|
|
|||
|
|
@ -151,7 +151,7 @@ namespace Microsoft.AspNetCore.Mvc.ApiExplorer
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void IsNameMatch_WithPrefix_ReturnsFalse_IfNameIsNotProperPrfix()
|
||||
public void IsNameMatch_WithPrefix_ReturnsFalse_IfNameIsNotProperPrefix()
|
||||
{
|
||||
// Arrange
|
||||
var name = "Postman";
|
||||
|
|
@ -386,7 +386,7 @@ namespace Microsoft.AspNetCore.Mvc.ApiExplorer
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void IsMatch_ReturnsTrue_IfMethodNameAndParametersMatchs()
|
||||
public void IsMatch_ReturnsTrue_IfMethodNameAndParametersMatches()
|
||||
{
|
||||
// Arrange
|
||||
var method = typeof(TestController).GetMethod(nameof(TestController.Get));
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
[InlineData("application/json")]
|
||||
[InlineData("application/json;Parameter1=12")]
|
||||
[InlineData("text/xml")]
|
||||
public void ActionConstraint_Accept_MatchesForMachingRequestContentType(string contentType)
|
||||
public void ActionConstraint_Accept_MatchesForMatchingRequestContentType(string contentType)
|
||||
{
|
||||
// Arrange
|
||||
var constraint = new ConsumesAttribute("application/json", "text/xml");
|
||||
|
|
|
|||
|
|
@ -1027,10 +1027,10 @@ namespace Microsoft.AspNetCore.Mvc.Core.Test
|
|||
// Arrange
|
||||
var controller = new TestableController();
|
||||
var pageName = "/Page-Name";
|
||||
var routeVaues = new { key = "value" };
|
||||
var routeValues = new { key = "value" };
|
||||
|
||||
// Act
|
||||
var result = controller.RedirectToPage(pageName, routeVaues);
|
||||
var result = controller.RedirectToPage(pageName, routeValues);
|
||||
|
||||
// Assert
|
||||
Assert.IsType<RedirectToPageResult>(result);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
Pipeline1.ConfigurePipeline = (ab) =>
|
||||
{
|
||||
configureCallCount++;
|
||||
ab.Use((httpCtxt, next) =>
|
||||
ab.Use((httpContext, next) =>
|
||||
{
|
||||
return next();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters
|
|||
httpContext.Setup(c => c.Request.Query.ContainsKey("format")).Returns(true);
|
||||
httpContext.Setup(c => c.Request.Query["format"]).Returns("xml");
|
||||
|
||||
// Routedata contains json
|
||||
// RouteData contains json
|
||||
var data = new RouteData();
|
||||
data.Values.Add("format", "json");
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters
|
|||
{
|
||||
get
|
||||
{
|
||||
// object value, bool useDeclaredTypeAsString, bool expectedCanwriteResult, bool useNonNullContentType
|
||||
// object value, bool useDeclaredTypeAsString, bool expectedCanWriteResult, bool useNonNullContentType
|
||||
yield return new object[] { "valid value", true, false, true };
|
||||
yield return new object[] { "valid value", false, false, true };
|
||||
yield return new object[] { "", false, false, true };
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void Constructor_WithNameAndInitalValue_IsValueSetIsFalse()
|
||||
public void Constructor_WithNameAndInitialValue_IsValueSetIsFalse()
|
||||
{
|
||||
// Arrange & Act
|
||||
var @switch = new CompatibilitySwitch<bool>("TestProperty", initialValue: true);
|
||||
|
|
@ -36,7 +36,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
|||
var @switch = new CompatibilitySwitch<bool>("TestProperty");
|
||||
|
||||
// Act
|
||||
@switch.Value = false; // You don't need to actually change the value, just caling the setting works
|
||||
@switch.Value = false; // You don't need to actually change the value, just calling the setting works
|
||||
|
||||
// Assert
|
||||
Assert.False(@switch.Value);
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void ActionDescriptors_UpdatesAndResubscripes_WhenChangeTokenTriggers()
|
||||
public void ActionDescriptors_UpdatesAndResubscribes_WhenChangeTokenTriggers()
|
||||
{
|
||||
// Arrange
|
||||
var actionDescriptorProvider = new Mock<IActionDescriptorProvider>();
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ using Xunit;
|
|||
|
||||
namespace Microsoft.AspNetCore.Mvc.Infrastructure
|
||||
{
|
||||
public class ProblemDetalsClientErrorFactoryTest
|
||||
public class ProblemDetailsClientErrorFactoryTest
|
||||
{
|
||||
[Fact]
|
||||
public void GetClientError_ReturnsProblemDetails_IfNoMappingWasFound()
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void InferBindingSourceForParameter_ReturnsPath_IfParameterAppearsInAnyRoutes_MulitpleRoutes()
|
||||
public void InferBindingSourceForParameter_ReturnsPath_IfParameterAppearsInAnyRoutes_MultipleRoutes()
|
||||
{
|
||||
// Arrange
|
||||
var actionName = nameof(ParameterBindingController.ParameterInMultipleRoutes);
|
||||
|
|
@ -1112,7 +1112,7 @@ Environment.NewLine + "int b";
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void DiscoverErrorResponseType_UsesValueFromApiErrorTypeAttribute_SpecifiedOnControllerAsssembly()
|
||||
public void DiscoverErrorResponseType_UsesValueFromApiErrorTypeAttribute_SpecifiedOnControllerAssembly()
|
||||
{
|
||||
// Arrange
|
||||
var expected = typeof(InvalidEnumArgumentException);
|
||||
|
|
|
|||
|
|
@ -1175,7 +1175,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
[Theory]
|
||||
[InlineData("A", typeof(ApiExplorerEnabledConventionalRoutedController))]
|
||||
[InlineData("A", typeof(ApiExplorerEnabledActionConventionalRoutedController))]
|
||||
public void ApiExplorer_ThrowsForContentionalRouting(string actionName, Type type)
|
||||
public void ApiExplorer_ThrowsForConventionalRouting(string actionName, Type type)
|
||||
{
|
||||
// Arrange
|
||||
var assemblyName = type.GetTypeInfo().Assembly.GetName().Name;
|
||||
|
|
|
|||
|
|
@ -1206,7 +1206,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(nameof(TestController.AsynActionMethodWithTestActionResult))]
|
||||
[InlineData(nameof(TestController.AsyncActionMethodWithTestActionResult))]
|
||||
[InlineData(nameof(TestController.ActionMethodWithTestActionResult))]
|
||||
public async Task InvokeAction_ReturnTypeAsIActionResult_ReturnsExpected(string methodName)
|
||||
{
|
||||
|
|
@ -1654,7 +1654,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
return new TestActionResult { Value = value };
|
||||
}
|
||||
|
||||
public async Task<TestActionResult> AsynActionMethodWithTestActionResult(int value)
|
||||
public async Task<TestActionResult> AsyncActionMethodWithTestActionResult(int value)
|
||||
{
|
||||
return await Task.FromResult<TestActionResult>(new TestActionResult { Value = value });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void EnumerateElements_TwoEnumerableImplemenations()
|
||||
public void EnumerateElements_TwoEnumerableImplementations()
|
||||
{
|
||||
// Arrange
|
||||
var model = new TwiceEnumerable(new int[] { 2, 3, 5 });
|
||||
|
|
|
|||
|
|
@ -1316,7 +1316,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
{
|
||||
{ model, new ValidationStateEntry() }
|
||||
};
|
||||
var method = GetType().GetMethod(nameof(Validate_Throws_ForTopLeveleMetadataData), BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
var method = GetType().GetMethod(nameof(Validate_Throws_ForTopLevelMetadataData), BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
var metadata = MetadataProvider.GetMetadataForParameter(method.GetParameters()[0]);
|
||||
|
||||
// Act & Assert
|
||||
|
|
@ -1465,7 +1465,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
void DoSomething();
|
||||
}
|
||||
|
||||
private void Validate_Throws_ForTopLeveleMetadataData(DepthObject depthObject) { }
|
||||
private void Validate_Throws_ForTopLevelMetadataData(DepthObject depthObject) { }
|
||||
|
||||
// Custom validation attribute that returns multiple entries in ValidationResult.MemberNames and those member
|
||||
// names are indexers. An example scenario is an attribute that confirms all entries in a list are unique.
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
{
|
||||
// Arrange
|
||||
var disableRequestSizeLimitResourceFilter = new DisableRequestSizeLimitFilter(NullLoggerFactory.Instance);
|
||||
var authorizationFilterContext = CreateauthorizationFilterContext(new IFilterMetadata[] { disableRequestSizeLimitResourceFilter });
|
||||
var authorizationFilterContext = CreateAuthorizationFilterContext(new IFilterMetadata[] { disableRequestSizeLimitResourceFilter });
|
||||
|
||||
var httpMaxRequestBodySize = new TestHttpMaxRequestBodySizeFeature();
|
||||
authorizationFilterContext.HttpContext.Features.Set<IHttpMaxRequestBodySizeFeature>(httpMaxRequestBodySize);
|
||||
|
|
@ -37,7 +37,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
// Arrange
|
||||
var disableRequestSizeLimitResourceFilter = new DisableRequestSizeLimitFilter(NullLoggerFactory.Instance);
|
||||
var disableRequestSizeLimitResourceFilterFinal = new DisableRequestSizeLimitFilter(NullLoggerFactory.Instance);
|
||||
var authorizationFilterContext = CreateauthorizationFilterContext(
|
||||
var authorizationFilterContext = CreateAuthorizationFilterContext(
|
||||
new IFilterMetadata[] { disableRequestSizeLimitResourceFilter, disableRequestSizeLimitResourceFilterFinal });
|
||||
|
||||
var httpMaxRequestBodySize = new TestHttpMaxRequestBodySizeFeature();
|
||||
|
|
@ -60,7 +60,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
var loggerFactory = new TestLoggerFactory(sink, enabled: true);
|
||||
|
||||
var disableRequestSizeLimitResourceFilter = new DisableRequestSizeLimitFilter(loggerFactory);
|
||||
var authorizationFilterContext = CreateauthorizationFilterContext(new IFilterMetadata[] { disableRequestSizeLimitResourceFilter });
|
||||
var authorizationFilterContext = CreateAuthorizationFilterContext(new IFilterMetadata[] { disableRequestSizeLimitResourceFilter });
|
||||
|
||||
// Act
|
||||
disableRequestSizeLimitResourceFilter.OnAuthorization(authorizationFilterContext);
|
||||
|
|
@ -79,7 +79,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
var loggerFactory = new TestLoggerFactory(sink, enabled: true);
|
||||
|
||||
var disableRequestSizeLimitResourceFilter = new DisableRequestSizeLimitFilter(loggerFactory);
|
||||
var authorizationFilterContext = CreateauthorizationFilterContext(new IFilterMetadata[] { disableRequestSizeLimitResourceFilter });
|
||||
var authorizationFilterContext = CreateAuthorizationFilterContext(new IFilterMetadata[] { disableRequestSizeLimitResourceFilter });
|
||||
|
||||
var httpMaxRequestBodySize = new TestHttpMaxRequestBodySizeFeature();
|
||||
httpMaxRequestBodySize.IsReadOnly = true;
|
||||
|
|
@ -101,7 +101,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
var loggerFactory = new TestLoggerFactory(sink, enabled: true);
|
||||
|
||||
var disableRequestSizeLimitResourceFilter = new DisableRequestSizeLimitFilter(loggerFactory);
|
||||
var authorizationFilterContext = CreateauthorizationFilterContext(new IFilterMetadata[] { disableRequestSizeLimitResourceFilter });
|
||||
var authorizationFilterContext = CreateAuthorizationFilterContext(new IFilterMetadata[] { disableRequestSizeLimitResourceFilter });
|
||||
|
||||
var httpMaxRequestBodySize = new TestHttpMaxRequestBodySizeFeature();
|
||||
authorizationFilterContext.HttpContext.Features.Set<IHttpMaxRequestBodySizeFeature>(httpMaxRequestBodySize);
|
||||
|
|
@ -114,7 +114,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
Assert.Equal($"The request body size limit has been disabled.", write.State.ToString());
|
||||
}
|
||||
|
||||
private static AuthorizationFilterContext CreateauthorizationFilterContext(IFilterMetadata[] filters)
|
||||
private static AuthorizationFilterContext CreateAuthorizationFilterContext(IFilterMetadata[] filters)
|
||||
{
|
||||
return new AuthorizationFilterContext(CreateActionContext(), filters);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void EnumerateElements_TwoEnumerableImplemenations()
|
||||
public void EnumerateElements_TwoEnumerableImplementations()
|
||||
{
|
||||
// Arrange
|
||||
var model = new TwiceEnumerable(new int[] { 2, 3, 5 });
|
||||
|
|
|
|||
|
|
@ -36,13 +36,13 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
{
|
||||
// Arrange
|
||||
Task requestDelegate(HttpContext context) => Task.FromResult(true);
|
||||
var middlwareFilter = new MiddlewareFilter(requestDelegate);
|
||||
var middlewareFilter = new MiddlewareFilter(requestDelegate);
|
||||
var httpContext = new DefaultHttpContext();
|
||||
var resourceExecutingContext = GetResourceExecutingContext(httpContext);
|
||||
var resourceExecutionDelegate = GetResourceExecutionDelegate(httpContext);
|
||||
|
||||
// Act
|
||||
await middlwareFilter.OnResourceExecutionAsync(resourceExecutingContext, resourceExecutionDelegate);
|
||||
await middlewareFilter.OnResourceExecutionAsync(resourceExecutingContext, resourceExecutionDelegate);
|
||||
|
||||
// Assert
|
||||
var feature = resourceExecutingContext.HttpContext.Features.Get<IMiddlewareFilterFeature>();
|
||||
|
|
@ -398,7 +398,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
logger,
|
||||
diagnosticSource,
|
||||
mapper,
|
||||
CreatControllerContext(actionContext, valueProviderFactories, maxAllowedErrorsInModelState),
|
||||
CreateControllerContext(actionContext, valueProviderFactories, maxAllowedErrorsInModelState),
|
||||
CreateCacheEntry((ControllerActionDescriptor)actionContext.ActionDescriptor, controllerFactory),
|
||||
filters)
|
||||
{
|
||||
|
|
@ -420,7 +420,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
return ObjectMethodExecutor.Create(actionDescriptor.MethodInfo, actionDescriptor.ControllerTypeInfo);
|
||||
}
|
||||
|
||||
private static ControllerContext CreatControllerContext(
|
||||
private static ControllerContext CreateControllerContext(
|
||||
ActionContext actionContext,
|
||||
IReadOnlyList<IValueProviderFactory> valueProviderFactories,
|
||||
int maxAllowedErrorsInModelState)
|
||||
|
|
|
|||
|
|
@ -112,9 +112,9 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
var asyncResultFilter = Mock.Of<IAsyncResultFilter>();
|
||||
var resourceFilter = Mock.Of<IResourceFilter>();
|
||||
var asyncResourceFilter = Mock.Of<IAsyncResourceFilter>();
|
||||
var orderedresourceFilterMock = new Mock<IOrderedResourceFilter>();
|
||||
orderedresourceFilterMock.SetupGet(f => f.Order).Returns(-100);
|
||||
var orderedResourceFilter = orderedresourceFilterMock.Object;
|
||||
var orderedResourceFilterMock = new Mock<IOrderedResourceFilter>();
|
||||
orderedResourceFilterMock.SetupGet(f => f.Order).Returns(-100);
|
||||
var orderedResourceFilter = orderedResourceFilterMock.Object;
|
||||
var filters = new IFilterMetadata[]
|
||||
{
|
||||
actionFilter,
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
// Arrange
|
||||
var requestFormLimitsFilter = new RequestFormLimitsFilter(NullLoggerFactory.Instance);
|
||||
requestFormLimitsFilter.FormOptions = new FormOptions();
|
||||
var authorizationFilterContext = CreateauthorizationFilterContext(
|
||||
var authorizationFilterContext = CreateAuthorizationFilterContext(
|
||||
new IFilterMetadata[] { requestFormLimitsFilter });
|
||||
// Set to null explicitly as we want to make sure the filter adds one
|
||||
authorizationFilterContext.HttpContext.Features.Set<IFormFeature>(null);
|
||||
|
|
@ -40,7 +40,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
// Arrange
|
||||
var requestFormLimitsFilter = new RequestFormLimitsFilter(NullLoggerFactory.Instance);
|
||||
requestFormLimitsFilter.FormOptions = new FormOptions();
|
||||
var authorizationFilterContext = CreateauthorizationFilterContext(
|
||||
var authorizationFilterContext = CreateAuthorizationFilterContext(
|
||||
new IFilterMetadata[] { requestFormLimitsFilter });
|
||||
var oldFormFeature = new FormFeature(authorizationFilterContext.HttpContext.Request);
|
||||
// Set to null explicitly as we want to make sure the filter adds one
|
||||
|
|
@ -63,7 +63,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
|
||||
var requestFormLimitsFilter = new RequestFormLimitsFilter(loggerFactory);
|
||||
requestFormLimitsFilter.FormOptions = new FormOptions();
|
||||
var authorizationFilterContext = CreateauthorizationFilterContext(
|
||||
var authorizationFilterContext = CreateAuthorizationFilterContext(
|
||||
new IFilterMetadata[] { requestFormLimitsFilter });
|
||||
authorizationFilterContext.HttpContext.Request.Form = new FormCollection(null);
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
|
||||
var requestFormLimitsFilter = new RequestFormLimitsFilter(loggerFactory);
|
||||
requestFormLimitsFilter.FormOptions = new FormOptions();
|
||||
var authorizationFilterContext = CreateauthorizationFilterContext(
|
||||
var authorizationFilterContext = CreateAuthorizationFilterContext(
|
||||
new IFilterMetadata[] { requestFormLimitsFilter });
|
||||
// Set to null explicitly as we want to make sure the filter adds one
|
||||
authorizationFilterContext.HttpContext.Features.Set<IFormFeature>(null);
|
||||
|
|
@ -112,7 +112,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
|
||||
var requestFormLimitsFilter = new RequestFormLimitsFilter(loggerFactory);
|
||||
requestFormLimitsFilter.FormOptions = new FormOptions();
|
||||
var authorizationFilterContext = CreateauthorizationFilterContext(
|
||||
var authorizationFilterContext = CreateAuthorizationFilterContext(
|
||||
new IFilterMetadata[] { requestFormLimitsFilter });
|
||||
// Set to null explicitly as we want to make sure the filter adds one
|
||||
authorizationFilterContext.HttpContext.Features.Set<IFormFeature>(
|
||||
|
|
@ -129,7 +129,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
write.State.ToString());
|
||||
}
|
||||
|
||||
private static AuthorizationFilterContext CreateauthorizationFilterContext(IFilterMetadata[] filters)
|
||||
private static AuthorizationFilterContext CreateAuthorizationFilterContext(IFilterMetadata[] filters)
|
||||
{
|
||||
return new AuthorizationFilterContext(CreateActionContext(), filters);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
// Arrange
|
||||
var requestSizeLimitResourceFilter = new RequestSizeLimitFilter(NullLoggerFactory.Instance);
|
||||
requestSizeLimitResourceFilter.Bytes = 12345;
|
||||
var authorizationFilterContext = CreateauthorizationFilterContext(new IFilterMetadata[] { requestSizeLimitResourceFilter });
|
||||
var authorizationFilterContext = CreateAuthorizationFilterContext(new IFilterMetadata[] { requestSizeLimitResourceFilter });
|
||||
|
||||
var httpMaxRequestBodySize = new TestHttpMaxRequestBodySizeFeature();
|
||||
authorizationFilterContext.HttpContext.Features.Set<IHttpMaxRequestBodySizeFeature>(httpMaxRequestBodySize);
|
||||
|
|
@ -40,7 +40,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
requestSizeLimitResourceFilter.Bytes = 12345;
|
||||
var requestSizeLimitResourceFilterFinal = new RequestSizeLimitFilter(NullLoggerFactory.Instance);
|
||||
requestSizeLimitResourceFilterFinal.Bytes = 0;
|
||||
var authorizationFilterContext = CreateauthorizationFilterContext(
|
||||
var authorizationFilterContext = CreateAuthorizationFilterContext(
|
||||
new IFilterMetadata[] { requestSizeLimitResourceFilter, requestSizeLimitResourceFilterFinal });
|
||||
|
||||
var httpMaxRequestBodySize = new TestHttpMaxRequestBodySizeFeature();
|
||||
|
|
@ -64,7 +64,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
|
||||
var requestSizeLimitResourceFilter = new RequestSizeLimitFilter(loggerFactory);
|
||||
requestSizeLimitResourceFilter.Bytes = 12345;
|
||||
var authorizationFilterContext = CreateauthorizationFilterContext(new IFilterMetadata[] { requestSizeLimitResourceFilter });
|
||||
var authorizationFilterContext = CreateAuthorizationFilterContext(new IFilterMetadata[] { requestSizeLimitResourceFilter });
|
||||
|
||||
// Act
|
||||
requestSizeLimitResourceFilter.OnAuthorization(authorizationFilterContext);
|
||||
|
|
@ -84,7 +84,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
|
||||
var requestSizeLimitResourceFilter = new RequestSizeLimitFilter(loggerFactory);
|
||||
requestSizeLimitResourceFilter.Bytes = 12345;
|
||||
var authorizationFilterContext = CreateauthorizationFilterContext(new IFilterMetadata[] { requestSizeLimitResourceFilter });
|
||||
var authorizationFilterContext = CreateAuthorizationFilterContext(new IFilterMetadata[] { requestSizeLimitResourceFilter });
|
||||
|
||||
var httpMaxRequestBodySize = new TestHttpMaxRequestBodySizeFeature();
|
||||
httpMaxRequestBodySize.IsReadOnly = true;
|
||||
|
|
@ -107,7 +107,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
|
||||
var requestSizeLimitResourceFilter = new RequestSizeLimitFilter(loggerFactory);
|
||||
requestSizeLimitResourceFilter.Bytes = 12345;
|
||||
var authorizationFilterContext = CreateauthorizationFilterContext(new IFilterMetadata[] { requestSizeLimitResourceFilter });
|
||||
var authorizationFilterContext = CreateAuthorizationFilterContext(new IFilterMetadata[] { requestSizeLimitResourceFilter });
|
||||
|
||||
var httpMaxRequestBodySize = new TestHttpMaxRequestBodySizeFeature();
|
||||
authorizationFilterContext.HttpContext.Features.Set<IHttpMaxRequestBodySizeFeature>(httpMaxRequestBodySize);
|
||||
|
|
@ -120,7 +120,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
|
|||
Assert.Equal($"The maximum request body size has been set to 12345.", write.State.ToString());
|
||||
}
|
||||
|
||||
private static AuthorizationFilterContext CreateauthorizationFilterContext(IFilterMetadata[] filters)
|
||||
private static AuthorizationFilterContext CreateAuthorizationFilterContext(IFilterMetadata[] filters)
|
||||
{
|
||||
return new AuthorizationFilterContext(CreateActionContext(), filters);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -467,7 +467,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
|
|||
|
||||
[Theory]
|
||||
[MemberData(nameof(DerivedInputFormattersThrowingNonInputFormatterException))]
|
||||
public async Task BindModel_DerivedXmlInputFormatters_ThrowingNonInputFormatingException_AddsErrorToModelState(
|
||||
public async Task BindModel_DerivedXmlInputFormatters_ThrowingNonInputFormattingException_AddsErrorToModelState(
|
||||
IInputFormatter formatter,
|
||||
string contentType,
|
||||
InputFormatterExceptionPolicy inputFormatterExceptionPolicy)
|
||||
|
|
|
|||
|
|
@ -42,14 +42,14 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
[InlineData(false, typeof(IntEnum))]
|
||||
[InlineData(false, typeof(FlagsEnum))]
|
||||
public async Task BindModel_AddsErrorToModelState_ForEmptyValue_AndNonNullableEnumTypes(
|
||||
bool suprressBindingUndefinedValueToEnumType,
|
||||
bool suppressBindingUndefinedValueToEnumType,
|
||||
Type modelType)
|
||||
{
|
||||
// Arrange
|
||||
var message = "The value '' is invalid.";
|
||||
var binderInfo = GetBinderAndContext(
|
||||
modelType,
|
||||
suprressBindingUndefinedValueToEnumType,
|
||||
suppressBindingUndefinedValueToEnumType,
|
||||
valueProviderValue: "");
|
||||
var bindingContext = binderInfo.Item1;
|
||||
var binder = binderInfo.Item2;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
|
|||
{
|
||||
[Theory]
|
||||
[InlineData(typeof(FormCollection))]
|
||||
[InlineData(typeof(DerviedFormCollection))]
|
||||
[InlineData(typeof(DerivedFormCollection))]
|
||||
public void Create_ThrowsException_ForFormCollectionModelType(Type modelType)
|
||||
{
|
||||
// Arrange
|
||||
|
|
@ -62,9 +62,9 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders
|
|||
{
|
||||
}
|
||||
|
||||
private class DerviedFormCollection : FormCollection
|
||||
private class DerivedFormCollection : FormCollection
|
||||
{
|
||||
public DerviedFormCollection() : base(fields: null, files: null) { }
|
||||
public DerivedFormCollection() : base(fields: null, files: null) { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -607,7 +607,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public async Task TryUpdataModel_ModelTypeDifferentFromModel_Throws()
|
||||
public async Task TryUpdateModel_ModelTypeDifferentFromModel_Throws()
|
||||
{
|
||||
// Arrange
|
||||
var metadataProvider = new EmptyModelMetadataProvider();
|
||||
|
|
|
|||
|
|
@ -21,10 +21,10 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
// Act & Assert
|
||||
foreach (var property in formOptionsProperties)
|
||||
{
|
||||
var formLimiAttributeProperty = formLimitsAttributeProperties
|
||||
var formLimitAttributeProperty = formLimitsAttributeProperties
|
||||
.Where(pi => property.Name == pi.Name && pi.PropertyType == property.PropertyType)
|
||||
.SingleOrDefault();
|
||||
Assert.NotNull(formLimiAttributeProperty);
|
||||
Assert.NotNull(formLimitAttributeProperty);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
[InlineData(null, false)]
|
||||
[InlineData(true, false)]
|
||||
[InlineData(false, true)]
|
||||
public void OnAuthorization_RedirectsToHttpsEndpoint_WithSpecifiedStatusCodeAndrequireHttpsPermanentOption(bool? permanent, bool requireHttpsPermanent)
|
||||
public void OnAuthorization_RedirectsToHttpsEndpoint_WithSpecifiedStatusCodeAndRequireHttpsPermanentOption(bool? permanent, bool requireHttpsPermanent)
|
||||
{
|
||||
var requestContext = new DefaultHttpContext();
|
||||
requestContext.RequestServices = CreateServices(null, requireHttpsPermanent);
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
|||
"testController",
|
||||
"testAction");
|
||||
actionDescriptor.RouteValues.Add("randomKey", "testRandom");
|
||||
var descriptorCollectionProvider = CreateActionDesciprtorCollectionProvider(actionDescriptor);
|
||||
var descriptorCollectionProvider = CreateActionDescriptorCollectionProvider(actionDescriptor);
|
||||
|
||||
var services = new ServiceCollection();
|
||||
services.AddRouting();
|
||||
|
|
@ -214,7 +214,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
|||
"testAction");
|
||||
actionDescriptor.RouteValues.Add("randomKey", "testRandom");
|
||||
|
||||
var provider = CreateActionDesciprtorCollectionProvider(actionDescriptor);
|
||||
var provider = CreateActionDescriptorCollectionProvider(actionDescriptor);
|
||||
|
||||
var constraint = new KnownRouteValueConstraint(provider);
|
||||
|
||||
|
|
@ -235,7 +235,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
|||
|
||||
private static HttpContext GetHttpContext(ActionDescriptor actionDescriptor, bool setupRequestServices = true)
|
||||
{
|
||||
var descriptorCollectionProvider = CreateActionDesciprtorCollectionProvider(actionDescriptor);
|
||||
var descriptorCollectionProvider = CreateActionDescriptorCollectionProvider(actionDescriptor);
|
||||
|
||||
var context = new Mock<HttpContext>();
|
||||
if (setupRequestServices)
|
||||
|
|
@ -247,7 +247,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing
|
|||
return context.Object;
|
||||
}
|
||||
|
||||
private static IActionDescriptorCollectionProvider CreateActionDesciprtorCollectionProvider(ActionDescriptor actionDescriptor)
|
||||
private static IActionDescriptorCollectionProvider CreateActionDescriptorCollectionProvider(ActionDescriptor actionDescriptor)
|
||||
{
|
||||
var actionProvider = new Mock<IActionDescriptorProvider>(MockBehavior.Strict);
|
||||
|
||||
|
|
|
|||
|
|
@ -340,7 +340,7 @@ namespace Microsoft.AspNetCore.Mvc.Core.Test.Routing
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void Page_UsesValueFromRouteValueIfPageHandlerIsNotExplicitySpecified()
|
||||
public void Page_UsesValueFromRouteValueIfPageHandlerIsNotExplicitlySpecified()
|
||||
{
|
||||
// Arrange
|
||||
UrlRouteContext actual = null;
|
||||
|
|
|
|||
|
|
@ -1555,7 +1555,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
var invoker = CreateInvoker(
|
||||
new IFilterMetadata[]
|
||||
{
|
||||
resourceFilter1.Object, // This filter should see the result retured from resourceFilter2
|
||||
resourceFilter1.Object, // This filter should see the result returned from resourceFilter2
|
||||
resourceFilter2.Object, // This filter will short circuit
|
||||
resourceFilter3.Object, // This shouldn't run - it will throw if it does
|
||||
exceptionFilter.Object, // This shouldn't run - it will throw if it does
|
||||
|
|
@ -1603,7 +1603,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
var invoker = CreateInvoker(
|
||||
new IFilterMetadata[]
|
||||
{
|
||||
resourceFilter1.Object, // This filter should see the result retured from resourceFilter2
|
||||
resourceFilter1.Object, // This filter should see the result returned from resourceFilter2
|
||||
resourceFilter2.Object, // This filter will short circuit
|
||||
resourceFilter3.Object, // This shouldn't run - it will throw if it does
|
||||
exceptionFilter.Object, // This shouldn't run - it will throw if it does
|
||||
|
|
@ -1653,7 +1653,7 @@ namespace Microsoft.AspNetCore.Mvc
|
|||
var invoker = CreateInvoker(
|
||||
new IFilterMetadata[]
|
||||
{
|
||||
resourceFilter1.Object, // This filter should see the result retured from resourceFilter2
|
||||
resourceFilter1.Object, // This filter should see the result returned from resourceFilter2
|
||||
resourceFilter2.Object,
|
||||
resourceFilter3.Object, // This shouldn't run - it will throw if it does
|
||||
resultFilter.Object // This shouldn't run - it will throw if it does
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
{
|
||||
private List<Action<BindingMetadata>> _bindingActions = new List<Action<BindingMetadata>>();
|
||||
private List<Action<DisplayMetadata>> _displayActions = new List<Action<DisplayMetadata>>();
|
||||
private List<Action<ValidationMetadata>> _valiationActions = new List<Action<ValidationMetadata>>();
|
||||
private List<Action<ValidationMetadata>> _validationActions = new List<Action<ValidationMetadata>>();
|
||||
|
||||
private readonly ModelMetadataIdentity _key;
|
||||
|
||||
|
|
@ -216,7 +216,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
{
|
||||
if (_key.Equals(context.Key))
|
||||
{
|
||||
foreach (var action in _valiationActions)
|
||||
foreach (var action in _validationActions)
|
||||
{
|
||||
action(context.ValidationMetadata);
|
||||
}
|
||||
|
|
@ -237,7 +237,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding
|
|||
|
||||
public IMetadataBuilder ValidationDetails(Action<ValidationMetadata> action)
|
||||
{
|
||||
_valiationActions.Add(action);
|
||||
_validationActions.Add(action);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Json
|
|||
public void OnProvidersExecuting_FindsJsonPatchDocuments_ProvidesOperationsArray()
|
||||
{
|
||||
// Arrange
|
||||
var metadataprovider = new TestModelMetadataProvider();
|
||||
var provider = new JsonPatchOperationsArrayProvider(metadataprovider);
|
||||
var metadataProvider = new TestModelMetadataProvider();
|
||||
var provider = new JsonPatchOperationsArrayProvider(metadataProvider);
|
||||
var jsonPatchParameterDescription = new ApiParameterDescription
|
||||
{
|
||||
Type = typeof(JsonPatchDocument)
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Xml.Internal
|
|||
[InlineData(typeof(List<Person>))]
|
||||
[InlineData(typeof(List<SerializableError>))]
|
||||
[InlineData(typeof(PersonList))]
|
||||
public void ThrowsArugmentExceptionFor_ConcreteEnumerableOfT(Type declaredType)
|
||||
public void ThrowsArgumentExceptionFor_ConcreteEnumerableOfT(Type declaredType)
|
||||
{
|
||||
// Arrange
|
||||
var expectedMessage = "The type must be an interface and must be or derive from 'IEnumerable`1'.";
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Xml.Internal
|
|||
public void Creates_WrapperProvider_ForSerializableErrorType(bool isSerialization)
|
||||
{
|
||||
// Arrange
|
||||
var serializableErroWrapperProviderFactory = new SerializableErrorWrapperProviderFactory();
|
||||
var serializableErrorWrapperProviderFactory = new SerializableErrorWrapperProviderFactory();
|
||||
|
||||
// Act
|
||||
var wrapperProvider = serializableErroWrapperProviderFactory.GetProvider(
|
||||
var wrapperProvider = serializableErrorWrapperProviderFactory.GetProvider(
|
||||
new WrapperProviderContext(typeof(SerializableError), isSerialization));
|
||||
|
||||
// Assert
|
||||
|
|
@ -28,10 +28,10 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Xml.Internal
|
|||
public void ReturnsNullFor_NonSerializableErrorTypes()
|
||||
{
|
||||
// Arrange
|
||||
var serializableErroWrapperProviderFactory = new SerializableErrorWrapperProviderFactory();
|
||||
var serializableErrorWrapperProviderFactory = new SerializableErrorWrapperProviderFactory();
|
||||
|
||||
// Act
|
||||
var wrapperProvider = serializableErroWrapperProviderFactory.GetProvider(
|
||||
var wrapperProvider = serializableErrorWrapperProviderFactory.GetProvider(
|
||||
new WrapperProviderContext(typeof(Person), isSerialization: true));
|
||||
|
||||
// Assert
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Xml
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void HasProperSuppportedMediaTypes()
|
||||
public void HasProperSupportedMediaTypes()
|
||||
{
|
||||
// Arrange & Act
|
||||
var formatter = new XmlDataContractSerializerInputFormatter(new MvcOptions());
|
||||
|
|
@ -123,7 +123,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Xml
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void HasProperSuppportedEncodings()
|
||||
public void HasProperSupportedEncodings()
|
||||
{
|
||||
// Arrange & Act
|
||||
var formatter = new XmlDataContractSerializerInputFormatter(new MvcOptions());
|
||||
|
|
|
|||
|
|
@ -349,7 +349,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Xml
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void HasProperSuppportedMediaTypes()
|
||||
public void HasProperSupportedMediaTypes()
|
||||
{
|
||||
// Arrange & Act
|
||||
var formatter = new XmlSerializerInputFormatter(new MvcOptions());
|
||||
|
|
@ -362,7 +362,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Xml
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void HasProperSuppportedEncodings()
|
||||
public void HasProperSupportedEncodings()
|
||||
{
|
||||
// Arrange & Act
|
||||
var formatter = new XmlSerializerInputFormatter(new MvcOptions());
|
||||
|
|
|
|||
|
|
@ -1359,7 +1359,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ApiConvention_ForActionWtihApiConventionMethod()
|
||||
public async Task ApiConvention_ForActionWithApiConventionMethod()
|
||||
{
|
||||
// Arrange
|
||||
var expectedMediaTypes = new[] { "application/json", "application/xml", "text/json", "text/xml" };
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
|||
[Theory]
|
||||
[InlineData("application/json")]
|
||||
[InlineData("text/json")]
|
||||
public async Task ActionLevelAttribute_OveridesClassLevel(string requestContentType)
|
||||
public async Task ActionLevelAttribute_OverridesClassLevel(string requestContentType)
|
||||
{
|
||||
// Arrange
|
||||
var input = "{SampleString:\"" + requestContentType + "\"}";
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
|||
private const string EnumUrl = "http://localhost/Enum/Enum";
|
||||
|
||||
[Fact]
|
||||
public async Task DataAnnotationLocalizionOfEnums_FromDataAnnotationLocalizerProvider()
|
||||
public async Task DataAnnotationLocalizationOfEnums_FromDataAnnotationLocalizerProvider()
|
||||
{
|
||||
// Arrange & Act
|
||||
var response = await Client.GetAsync(EnumUrl);
|
||||
|
|
|
|||
|
|
@ -404,7 +404,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
|||
Assert.Equal(expected2, response2.Trim());
|
||||
|
||||
// Act - 3
|
||||
// Resend the cookiesless request and cached result from the first response.
|
||||
// Resend the cookieless request and cached result from the first response.
|
||||
var response3 = await Client.GetStringAsync("/catalog/cart?correlationid=3");
|
||||
|
||||
// Assert - 3
|
||||
|
|
|
|||
|
|
@ -1422,7 +1422,7 @@ Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary`1[AspNetCore.InjectedPa
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ViewDataAvaialableInPageFilter_AfterHandlerMethod_ReturnsPageResult()
|
||||
public async Task ViewDataAwaitableInPageFilter_AfterHandlerMethod_ReturnsPageResult()
|
||||
{
|
||||
// Act
|
||||
var content = await Client.GetStringAsync("http://localhost/Pages/ViewDataAvailableAfterHandlerExecuted");
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ Hello from /Pages/Shared/";
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public async Task AllowAnonymouseToPageConvention_CanBeAppliedToAreaPages()
|
||||
public async Task AllowAnonymousToPageConvention_CanBeAppliedToAreaPages()
|
||||
{
|
||||
// Act
|
||||
var response = await Client.GetStringAsync("/Accounts/RequiresAuth/AllowAnonymous");
|
||||
|
|
@ -395,7 +395,7 @@ Hello from /Pages/Shared/";
|
|||
|
||||
// These test is important as it covers a feature that allows razor pages to use a different
|
||||
// model at runtime that wasn't known at compile time. Like a non-generic model used at compile
|
||||
// time and overrided at runtime with a closed-generic model that performs the actual implementation.
|
||||
// time and overriden at runtime with a closed-generic model that performs the actual implementation.
|
||||
// An example of this is how the Identity UI library defines a base page model in their views,
|
||||
// like how the Register.cshtml view defines its model as RegisterModel and then, at runtime it replaces
|
||||
// that model with RegisterModel<TUser> where TUser is the type of the user used to configure identity.
|
||||
|
|
@ -506,7 +506,7 @@ Hello from /Pages/Shared/";
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ViewDataAttributes_SetInPageModel_AreTransferedToLayout()
|
||||
public async Task ViewDataAttributes_SetInPageModel_AreTransferredToLayout()
|
||||
{
|
||||
// Arrange
|
||||
var document = await Client.GetHtmlDocumentAsync("/ViewData/ViewDataInPage");
|
||||
|
|
@ -526,7 +526,7 @@ Hello from /Pages/Shared/";
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ViewDataAttributes_SetInPageWithoutModel_AreTransferedToLayout()
|
||||
public async Task ViewDataAttributes_SetInPageWithoutModel_AreTransferredToLayout()
|
||||
{
|
||||
// Arrange
|
||||
var document = await Client.GetHtmlDocumentAsync("/ViewData/ViewDataInPageWithoutModel");
|
||||
|
|
|
|||
|
|
@ -921,7 +921,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public virtual async Task AttributeRoutedAction_LinkWithName_WithNameOverrridenFromController()
|
||||
public virtual async Task AttributeRoutedAction_LinkWithName_WithNameOverridenFromController()
|
||||
{
|
||||
// Arrange & Act
|
||||
var response = await Client.DeleteAsync("http://localhost/api/Company/5");
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
|||
public HttpClient Client { get; }
|
||||
|
||||
[Fact]
|
||||
public async Task JsonSerializeFormated()
|
||||
public async Task JsonSerializeFormatted()
|
||||
{
|
||||
// Arrange
|
||||
var expected = "{" + Environment.NewLine
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ReregisteringAntiforgeryTokenInsideFormTagHelper_DoesNotAddDuplicateAntiforgeryTokenFields()
|
||||
public async Task ReRegisteringAntiforgeryTokenInsideFormTagHelper_DoesNotAddDuplicateAntiforgeryTokenFields()
|
||||
{
|
||||
// Arrange
|
||||
var expectedMediaType = MediaTypeHeaderValue.Parse("text/html; charset=utf-8");
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public async Task ActionThrowsHttpResponseException_EnsureGlobalHttpresponseExceptionActionFilter_IsInvoked()
|
||||
public async Task ActionThrowsHttpResponseException_EnsureGlobalHttpResponseExceptionActionFilter_IsInvoked()
|
||||
{
|
||||
// Arrange & Act
|
||||
var response = await Client.GetAsync(
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ namespace Microsoft.AspNetCore.Mvc.FunctionalTests
|
|||
|
||||
// Verifies that the model state has errors related to body model validation.
|
||||
[Fact]
|
||||
public async Task DataMissingForRefereneceTypeProperties_AndModelIsBound_AndHasMixedValidationErrors()
|
||||
public async Task DataMissingForReferenceTypeProperties_AndModelIsBound_AndHasMixedValidationErrors()
|
||||
{
|
||||
// Arrange
|
||||
var input = "<Store xmlns=\"http://schemas.datacontract.org/2004/07/XmlFormattersWebSite\"" +
|
||||
|
|
|
|||
|
|
@ -2403,7 +2403,7 @@ namespace Microsoft.AspNetCore.Mvc.IntegrationTests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public async Task MutableObjectModelBinder_WithRequiredProperty_NoData_CustomPrefix_GetsErros()
|
||||
public async Task MutableObjectModelBinder_WithRequiredProperty_NoData_CustomPrefix_GetsErrors()
|
||||
{
|
||||
// Arrange
|
||||
var parameter = new ParameterDescriptor()
|
||||
|
|
@ -2507,7 +2507,7 @@ namespace Microsoft.AspNetCore.Mvc.IntegrationTests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public async Task MutableObjectModelBinder_WithRequiredCollectionProperty_NoData_GetsErros()
|
||||
public async Task MutableObjectModelBinder_WithRequiredCollectionProperty_NoData_GetsErrors()
|
||||
{
|
||||
// Arrange
|
||||
var parameter = new ParameterDescriptor()
|
||||
|
|
@ -2555,7 +2555,7 @@ namespace Microsoft.AspNetCore.Mvc.IntegrationTests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public async Task MutableObjectModelBinder_WithRequiredCollectionProperty_NoData_CustomPrefix_GetsErros()
|
||||
public async Task MutableObjectModelBinder_WithRequiredCollectionProperty_NoData_CustomPrefix_GetsErrors()
|
||||
{
|
||||
// Arrange
|
||||
var parameter = new ParameterDescriptor()
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ namespace Microsoft.AspNetCore.Mvc.IntegrationTests
|
|||
var categoryRequired = ValidationAttributeUtil.GetRequiredErrorMessage("Category");
|
||||
var priceRange = ValidationAttributeUtil.GetRangeErrorMessage(20, 100, "Price");
|
||||
var contactUsMax = ValidationAttributeUtil.GetStringLengthErrorMessage(null, 20, "Contact Us");
|
||||
var contactusRegEx = ValidationAttributeUtil.GetRegExErrorMessage("^[0-9]*$", "Contact Us");
|
||||
var contactUsRegEx = ValidationAttributeUtil.GetRegExErrorMessage("^[0-9]*$", "Contact Us");
|
||||
|
||||
// Act
|
||||
var result = controller.TryValidateModel(model);
|
||||
|
|
@ -128,11 +128,11 @@ namespace Microsoft.AspNetCore.Mvc.IntegrationTests
|
|||
Assert.Equal("CompanyName cannot be null or empty.", modelStateErrors["[0].CompanyName"]);
|
||||
Assert.Equal(priceRange, modelStateErrors["[0].Price"]);
|
||||
Assert.Equal(categoryRequired, modelStateErrors["[0].Category"]);
|
||||
AssertErrorEquals(contactUsMax + contactusRegEx, modelStateErrors["[0].Contact"]);
|
||||
AssertErrorEquals(contactUsMax + contactUsRegEx, modelStateErrors["[0].Contact"]);
|
||||
Assert.Equal("CompanyName cannot be null or empty.", modelStateErrors["[1].CompanyName"]);
|
||||
Assert.Equal(priceRange, modelStateErrors["[1].Price"]);
|
||||
Assert.Equal(categoryRequired, modelStateErrors["[1].Category"]);
|
||||
AssertErrorEquals(contactUsMax + contactusRegEx, modelStateErrors["[1].Contact"]);
|
||||
AssertErrorEquals(contactUsMax + contactUsRegEx, modelStateErrors["[1].Contact"]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
|||
|
|
@ -1023,7 +1023,7 @@ namespace Microsoft.AspNetCore.Mvc.IntegrationTests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Validation_StringLengthAttribute_OnProperyOfCollectionElement_Valid()
|
||||
public async Task Validation_StringLengthAttribute_OnPropertyOfCollectionElement_Valid()
|
||||
{
|
||||
// Arrange
|
||||
var parameterBinder = ModelBindingTestHelper.GetParameterBinder();
|
||||
|
|
@ -1060,7 +1060,7 @@ namespace Microsoft.AspNetCore.Mvc.IntegrationTests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Validation_StringLengthAttribute_OnProperyOfCollectionElement_Invalid()
|
||||
public async Task Validation_StringLengthAttribute_OnPropertyOfCollectionElement_Invalid()
|
||||
{
|
||||
// Arrange
|
||||
var parameterBinder = ModelBindingTestHelper.GetParameterBinder();
|
||||
|
|
@ -1100,7 +1100,7 @@ namespace Microsoft.AspNetCore.Mvc.IntegrationTests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Validation_StringLengthAttribute_OnProperyOfCollectionElement_NoData()
|
||||
public async Task Validation_StringLengthAttribute_OnPropertyOfCollectionElement_NoData()
|
||||
{
|
||||
// Arrange
|
||||
var parameterBinder = ModelBindingTestHelper.GetParameterBinder();
|
||||
|
|
@ -1701,7 +1701,7 @@ namespace Microsoft.AspNetCore.Mvc.IntegrationTests
|
|||
// basically result in clearing out all model errors, which is BAD.
|
||||
//
|
||||
// The fix is to treat non-user-input as have a key of null, which means that the MSD
|
||||
// isn't even examined when it comes to supressing validation.
|
||||
// isn't even examined when it comes to suppressing validation.
|
||||
[Fact]
|
||||
public async Task CancellationToken_WithEmptyPrefix_DoesNotSuppressUnrelatedErrors()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor.Internal
|
|||
[InlineData(@"Areas\Finances\Views\Home\Index.cshtml")]
|
||||
[InlineData(@"\Areas\Finances\Views\Home\Index.cshtml")]
|
||||
[InlineData(@"\Areas\Finances\Views/Home\Index.cshtml")]
|
||||
public async Task CompileAsync_NormalizesPathSepartorForPaths(string relativePath)
|
||||
public async Task CompileAsync_NormalizesPathSeparatorForPaths(string relativePath)
|
||||
{
|
||||
// Arrange
|
||||
var viewPath = "/Areas/Finances/Views/Home/Index.cshtml";
|
||||
|
|
@ -731,7 +731,7 @@ this should fail";
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void Compile_InvokessCallback()
|
||||
public void Compile_InvokesCallback()
|
||||
{
|
||||
// Arrange
|
||||
var content = "public class MyTestType {}";
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor
|
|||
Assert.Same(DiagnosticSource, instance.DiagnosticSource);
|
||||
Assert.Same(HtmlEncoder, instance.HtmlEncoder);
|
||||
|
||||
// When we don't have a model property, the activator will just leave viewdata alone.
|
||||
// When we don't have a model property, the activator will just leave ViewData alone.
|
||||
Assert.NotNull(viewContext.ViewData);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor
|
|||
|
||||
Assert.Equal(1, bufferScope.CreatedBuffers.Count);
|
||||
Assert.Equal(0, bufferScope.ReturnedBuffers.Count);
|
||||
v.Write("Level:1-A"); // Creates a new buffer for the taghelper.
|
||||
v.Write("Level:1-A"); // Creates a new buffer for the TagHelper.
|
||||
Assert.Equal(2, bufferScope.CreatedBuffers.Count);
|
||||
Assert.Equal(0, bufferScope.ReturnedBuffers.Count);
|
||||
|
||||
|
|
@ -318,7 +318,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor
|
|||
|
||||
Assert.Equal(2, bufferScope.CreatedBuffers.Count);
|
||||
Assert.Equal(0, bufferScope.ReturnedBuffers.Count);
|
||||
v.Write(outputLevel1); // Writing the taghelper to output returns a buffer.
|
||||
v.Write(outputLevel1); // Writing the TagHelper to output returns a buffer.
|
||||
Assert.Equal(2, bufferScope.CreatedBuffers.Count);
|
||||
Assert.Equal(1, bufferScope.ReturnedBuffers.Count);
|
||||
}
|
||||
|
|
@ -335,7 +335,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor
|
|||
|
||||
Assert.Equal(2, bufferScope.CreatedBuffers.Count);
|
||||
Assert.Equal(1, bufferScope.ReturnedBuffers.Count);
|
||||
v.Write("Level:1-B"); // Creates a new buffer for the taghelper.
|
||||
v.Write("Level:1-B"); // Creates a new buffer for the TagHelper.
|
||||
Assert.Equal(3, bufferScope.CreatedBuffers.Count);
|
||||
Assert.Equal(1, bufferScope.ReturnedBuffers.Count);
|
||||
|
||||
|
|
@ -351,7 +351,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor
|
|||
|
||||
Assert.Equal(3, bufferScope.CreatedBuffers.Count);
|
||||
Assert.Equal(1, bufferScope.ReturnedBuffers.Count);
|
||||
v.Write("Level:2"); // Creates a new buffer for the taghelper.
|
||||
v.Write("Level:2"); // Creates a new buffer for the TagHelper.
|
||||
Assert.Equal(4, bufferScope.CreatedBuffers.Count);
|
||||
Assert.Equal(1, bufferScope.ReturnedBuffers.Count);
|
||||
|
||||
|
|
@ -366,7 +366,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor
|
|||
|
||||
Assert.Equal(4, bufferScope.CreatedBuffers.Count);
|
||||
Assert.Equal(1, bufferScope.ReturnedBuffers.Count);
|
||||
v.Write(outputLevel2); // Writing the taghelper to output returns a buffer.
|
||||
v.Write(outputLevel2); // Writing the TagHelper to output returns a buffer.
|
||||
Assert.Equal(4, bufferScope.CreatedBuffers.Count);
|
||||
Assert.Equal(2, bufferScope.ReturnedBuffers.Count);
|
||||
}
|
||||
|
|
@ -382,7 +382,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor
|
|||
|
||||
Assert.Equal(4, bufferScope.CreatedBuffers.Count);
|
||||
Assert.Equal(2, bufferScope.ReturnedBuffers.Count);
|
||||
v.Write(outputLevel1); // Writing the taghelper to output returns a buffer.
|
||||
v.Write(outputLevel1); // Writing the TagHelper to output returns a buffer.
|
||||
Assert.Equal(4, bufferScope.CreatedBuffers.Count);
|
||||
Assert.Equal(3, bufferScope.ReturnedBuffers.Count);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -749,7 +749,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void FindView_NoramlizesPaths_ReturnedByViewLocationExpanders()
|
||||
public void FindView_NormalizesPaths_ReturnedByViewLocationExpanders()
|
||||
{
|
||||
// Arrange
|
||||
var pageFactory = new Mock<IRazorPageFactoryProvider>();
|
||||
|
|
@ -2040,8 +2040,8 @@ namespace Microsoft.AspNetCore.Mvc.Razor
|
|||
routeData.Values.Add(kvp.Key, kvp.Value);
|
||||
}
|
||||
|
||||
var actionDesciptor = new ActionDescriptor();
|
||||
return new ActionContext(httpContext, routeData, actionDesciptor);
|
||||
var actionDescriptor = new ActionDescriptor();
|
||||
return new ActionContext(httpContext, routeData, actionDescriptor);
|
||||
}
|
||||
|
||||
private static ActionContext GetActionContextWithActionDescriptor(
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue