Changes per PR comments

Reformatting parameter identation
This commit is contained in:
Pranav K 2015-09-17 15:30:39 -07:00
parent a68d9e4cb1
commit 7b433820b1
55 changed files with 333 additions and 248 deletions

View File

@ -14,7 +14,10 @@ namespace Microsoft.AspNet.JsonPatch.Converters
{ {
public class TypedJsonPatchDocumentConverter : JsonPatchDocumentConverter public class TypedJsonPatchDocumentConverter : JsonPatchDocumentConverter
{ {
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, public override object ReadJson(
JsonReader reader,
Type objectType,
object existingValue,
JsonSerializer serializer) JsonSerializer serializer)
{ {
try try

View File

@ -9,8 +9,10 @@ namespace Microsoft.AspNet.JsonPatch.Helpers
// Helper methods to allow case-insensitive key search // Helper methods to allow case-insensitive key search
internal static class ExpandoObjectDictionaryExtensions internal static class ExpandoObjectDictionaryExtensions
{ {
internal static void SetValueForCaseInsensitiveKey(this IDictionary<string, object> propertyDictionary, internal static void SetValueForCaseInsensitiveKey(
string key, object value) this IDictionary<string, object> propertyDictionary,
string key,
object value)
{ {
foreach (KeyValuePair<string, object> kvp in propertyDictionary) foreach (KeyValuePair<string, object> kvp in propertyDictionary)
{ {
@ -22,7 +24,8 @@ namespace Microsoft.AspNet.JsonPatch.Helpers
} }
} }
internal static void RemoveValueForCaseInsensitiveKey(this IDictionary<string, object> propertyDictionary, internal static void RemoveValueForCaseInsensitiveKey(
this IDictionary<string, object> propertyDictionary,
string key) string key)
{ {
string realKey = null; string realKey = null;
@ -41,7 +44,8 @@ namespace Microsoft.AspNet.JsonPatch.Helpers
} }
} }
internal static object GetValueForCaseInsensitiveKey(this IDictionary<string, object> propertyDictionary, internal static object GetValueForCaseInsensitiveKey(
this IDictionary<string, object> propertyDictionary,
string key) string key)
{ {
foreach (KeyValuePair<string, object> kvp in propertyDictionary) foreach (KeyValuePair<string, object> kvp in propertyDictionary)
@ -55,7 +59,8 @@ namespace Microsoft.AspNet.JsonPatch.Helpers
throw new ArgumentException(Resources.FormatDictionaryKeyNotFound(key)); throw new ArgumentException(Resources.FormatDictionaryKeyNotFound(key));
} }
internal static bool ContainsCaseInsensitiveKey(this IDictionary<string, object> propertyDictionary, internal static bool ContainsCaseInsensitiveKey(
this IDictionary<string, object> propertyDictionary,
string key) string key)
{ {
foreach (KeyValuePair<string, object> kvp in propertyDictionary) foreach (KeyValuePair<string, object> kvp in propertyDictionary)
@ -65,8 +70,8 @@ namespace Microsoft.AspNet.JsonPatch.Helpers
return true; return true;
} }
} }
return false;
return false;
} }
} }
} }

View File

@ -8,7 +8,8 @@ namespace Microsoft.AspNet.Mvc.ModelBinding.Validation
{ {
public class ClientModelValidationContext public class ClientModelValidationContext
{ {
public ClientModelValidationContext([NotNull] ModelMetadata metadata, public ClientModelValidationContext(
[NotNull] ModelMetadata metadata,
[NotNull] IModelMetadataProvider metadataProvider, [NotNull] IModelMetadataProvider metadataProvider,
[NotNull] IServiceProvider requestServices) [NotNull] IServiceProvider requestServices)
{ {

View File

@ -17,7 +17,8 @@ namespace Microsoft.AspNet.Mvc.ModelBinding.Validation
{ {
} }
public ModelClientValidationRule([NotNull] string validationType, public ModelClientValidationRule(
[NotNull] string validationType,
[NotNull] string errorMessage) [NotNull] string errorMessage)
{ {
ValidationType = validationType; ValidationType = validationType;

View File

@ -802,7 +802,8 @@ namespace Microsoft.AspNet.Mvc.Actions
private class MethodToActionMap : private class MethodToActionMap :
Dictionary<MethodInfo, IDictionary<ActionModel, IList<ControllerActionDescriptor>>> Dictionary<MethodInfo, IDictionary<ActionModel, IList<ControllerActionDescriptor>>>
{ {
public void AddToMethodInfo(ActionModel action, public void AddToMethodInfo(
ActionModel action,
IList<ControllerActionDescriptor> actionDescriptors) IList<ControllerActionDescriptor> actionDescriptors)
{ {
IDictionary<ActionModel, IList<ControllerActionDescriptor>> actionsForMethod = null; IDictionary<ActionModel, IList<ControllerActionDescriptor>> actionsForMethod = null;

View File

@ -46,7 +46,8 @@ namespace Microsoft.AspNet.Mvc.Actions
/// <param name="typeInfo">The <see cref="TypeInfo"/>.</param> /// <param name="typeInfo">The <see cref="TypeInfo"/>.</param>
/// <param name="candidateAssemblies">The set of candidate assemblies.</param> /// <param name="candidateAssemblies">The set of candidate assemblies.</param>
/// <returns><c>true</c> if the <paramref name="typeInfo"/> is a controller. Otherwise <c>false</c>.</returns> /// <returns><c>true</c> if the <paramref name="typeInfo"/> is a controller. Otherwise <c>false</c>.</returns>
protected internal virtual bool IsController([NotNull] TypeInfo typeInfo, protected internal virtual bool IsController(
[NotNull] TypeInfo typeInfo,
[NotNull] ISet<Assembly> candidateAssemblies) [NotNull] ISet<Assembly> candidateAssemblies)
{ {
if (!typeInfo.IsClass) if (!typeInfo.IsClass)

View File

@ -16,7 +16,8 @@ namespace Microsoft.AspNet.Mvc.ApplicationModels
" Route: {AttributeRouteModel?.Template}, Filters: {Filters.Count}")] " Route: {AttributeRouteModel?.Template}, Filters: {Filters.Count}")]
public class ActionModel public class ActionModel
{ {
public ActionModel([NotNull] MethodInfo actionMethod, public ActionModel(
[NotNull] MethodInfo actionMethod,
[NotNull] IReadOnlyList<object> attributes) [NotNull] IReadOnlyList<object> attributes)
{ {
ActionMethod = actionMethod; ActionMethod = actionMethod;

View File

@ -16,7 +16,8 @@ namespace Microsoft.AspNet.Mvc.ApplicationModels
" Routes: {AttributeRoutes.Count}, Filters: {Filters.Count}")] " Routes: {AttributeRoutes.Count}, Filters: {Filters.Count}")]
public class ControllerModel public class ControllerModel
{ {
public ControllerModel([NotNull] TypeInfo controllerType, public ControllerModel(
[NotNull] TypeInfo controllerType,
[NotNull] IReadOnlyList<object> attributes) [NotNull] IReadOnlyList<object> attributes)
{ {
ControllerType = controllerType; ControllerType = controllerType;

View File

@ -12,7 +12,8 @@ namespace Microsoft.AspNet.Mvc.ApplicationModels
[DebuggerDisplay("ParameterModel: Name={ParameterName}")] [DebuggerDisplay("ParameterModel: Name={ParameterName}")]
public class ParameterModel public class ParameterModel
{ {
public ParameterModel([NotNull] ParameterInfo parameterInfo, public ParameterModel(
[NotNull] ParameterInfo parameterInfo,
[NotNull] IReadOnlyList<object> attributes) [NotNull] IReadOnlyList<object> attributes)
{ {
ParameterInfo = parameterInfo; ParameterInfo = parameterInfo;

View File

@ -20,7 +20,8 @@ namespace Microsoft.AspNet.Mvc.ApplicationModels
/// </summary> /// </summary>
/// <param name="propertyInfo">The <see cref="PropertyInfo"/> for the underlying property.</param> /// <param name="propertyInfo">The <see cref="PropertyInfo"/> for the underlying property.</param>
/// <param name="attributes">Any attributes which are annotated on the property.</param> /// <param name="attributes">Any attributes which are annotated on the property.</param>
public PropertyModel([NotNull] PropertyInfo propertyInfo, public PropertyModel(
[NotNull] PropertyInfo propertyInfo,
[NotNull] IReadOnlyList<object> attributes) [NotNull] IReadOnlyList<object> attributes)
{ {
PropertyInfo = propertyInfo; PropertyInfo = propertyInfo;

View File

@ -25,7 +25,8 @@ namespace Microsoft.AspNet.Mvc
/// <param name="controllerName">The name of the controller to use for generating the URL.</param> /// <param name="controllerName">The name of the controller to use for generating the URL.</param>
/// <param name="routeValues">The route data to use for generating the URL.</param> /// <param name="routeValues">The route data to use for generating the URL.</param>
/// <param name="value">The value to format in the entity body.</param> /// <param name="value">The value to format in the entity body.</param>
public CreatedAtActionResult(string actionName, public CreatedAtActionResult(
string actionName,
string controllerName, string controllerName,
object routeValues, object routeValues,
object value) object value)

View File

@ -36,7 +36,8 @@ namespace Microsoft.AspNet.Mvc
/// <param name="routeName">The name of the route to use for generating the URL.</param> /// <param name="routeName">The name of the route to use for generating the URL.</param>
/// <param name="routeValues">The route data to use for generating the URL.</param> /// <param name="routeValues">The route data to use for generating the URL.</param>
/// <param name="value">The value to format in the entity body.</param> /// <param name="value">The value to format in the entity body.</param>
public CreatedAtRouteResult(string routeName, public CreatedAtRouteResult(
string routeName,
object routeValues, object routeValues,
object value) object value)
: base(value) : base(value)

View File

@ -107,8 +107,12 @@ namespace Microsoft.AspNet.Mvc.Internal
} }
#if DNX451 #if DNX451
/// <inheritdoc /> /// <inheritdoc />
public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, public override IAsyncResult BeginRead(
AsyncCallback callback, object state) byte[] buffer,
int offset,
int count,
AsyncCallback callback,
object state)
{ {
return _innerStream.BeginRead(buffer, offset, count, callback, state); return _innerStream.BeginRead(buffer, offset, count, callback, state);
} }
@ -162,8 +166,12 @@ namespace Microsoft.AspNet.Mvc.Internal
} }
#if DNX451 #if DNX451
/// <inheritdoc /> /// <inheritdoc />
public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, public override IAsyncResult BeginWrite(
AsyncCallback callback, object state) byte[] buffer,
int offset,
int count,
AsyncCallback callback,
object state)
{ {
return _innerStream.BeginWrite(buffer, offset, count, callback, state); return _innerStream.BeginWrite(buffer, offset, count, callback, state);
} }

View File

@ -457,7 +457,8 @@ namespace Microsoft.AspNet.Mvc
} }
} }
internal static void ValidateBindingContext(ModelBindingContext bindingContext, internal static void ValidateBindingContext(
ModelBindingContext bindingContext,
Type requiredType, Type requiredType,
bool allowNullModel) bool allowNullModel)
{ {

View File

@ -17,7 +17,8 @@ namespace Microsoft.AspNet.Mvc.Routing
{ {
private RouteValuesCollection _cachedValuesCollection; private RouteValuesCollection _cachedValuesCollection;
public bool Match([NotNull] HttpContext httpContext, public bool Match(
[NotNull] HttpContext httpContext,
[NotNull] IRouter route, [NotNull] IRouter route,
[NotNull] string routeKey, [NotNull] string routeKey,
[NotNull] IDictionary<string, object> values, [NotNull] IDictionary<string, object> values,

View File

@ -15,7 +15,8 @@ namespace Microsoft.AspNet.Mvc.ModelBinding.Validation
/// </summary> /// </summary>
public class DataTypeAttributeAdapter : DataAnnotationsClientModelValidator<DataTypeAttribute> public class DataTypeAttributeAdapter : DataAnnotationsClientModelValidator<DataTypeAttribute>
{ {
public DataTypeAttributeAdapter(DataTypeAttribute attribute, public DataTypeAttributeAdapter(
DataTypeAttribute attribute,
[NotNull] string ruleName) [NotNull] string ruleName)
: base(attribute) : base(attribute)
{ {

View File

@ -13,7 +13,8 @@ namespace Microsoft.AspNet.Mvc.ModelBinding.Validation
private const string EqualToValidationType = "equalto"; private const string EqualToValidationType = "equalto";
private const string EqualToValidationParameter = "other"; private const string EqualToValidationParameter = "other";
public ModelClientValidationEqualToRule([NotNull] string errorMessage, public ModelClientValidationEqualToRule(
[NotNull] string errorMessage,
[NotNull] object other) [NotNull] object other)
: base(EqualToValidationType, errorMessage) : base(EqualToValidationType, errorMessage)
{ {

View File

@ -11,7 +11,8 @@ namespace Microsoft.AspNet.Mvc.ModelBinding.Validation
private const string MinValidationParameter = "min"; private const string MinValidationParameter = "min";
private const string MaxValidationParameter = "max"; private const string MaxValidationParameter = "max";
public ModelClientValidationRangeRule([NotNull] string errorMessage, public ModelClientValidationRangeRule(
[NotNull] string errorMessage,
[NotNull] object minValue, [NotNull] object minValue,
[NotNull] object maxValue) [NotNull] object maxValue)
: base(RangeValidationType, errorMessage) : base(RangeValidationType, errorMessage)

View File

@ -156,7 +156,8 @@ namespace Microsoft.AspNet.Mvc.Formatters
/// </summary> /// </summary>
/// <param name="writeStream">The stream on which the XmlWriter should operate on.</param> /// <param name="writeStream">The stream on which the XmlWriter should operate on.</param>
/// <returns>A new instance of <see cref="XmlWriter"/></returns> /// <returns>A new instance of <see cref="XmlWriter"/></returns>
public virtual XmlWriter CreateXmlWriter([NotNull] Stream writeStream, public virtual XmlWriter CreateXmlWriter(
[NotNull] Stream writeStream,
[NotNull] XmlWriterSettings xmlWriterSettings) [NotNull] XmlWriterSettings xmlWriterSettings)
{ {
return XmlWriter.Create( return XmlWriter.Create(

View File

@ -131,7 +131,8 @@ namespace Microsoft.AspNet.Mvc.Formatters
/// </summary> /// </summary>
/// <param name="writeStream">The stream on which the XmlWriter should operate on.</param> /// <param name="writeStream">The stream on which the XmlWriter should operate on.</param>
/// <returns>A new instance of <see cref="XmlWriter"/></returns> /// <returns>A new instance of <see cref="XmlWriter"/></returns>
public virtual XmlWriter CreateXmlWriter([NotNull] Stream writeStream, public virtual XmlWriter CreateXmlWriter(
[NotNull] Stream writeStream,
[NotNull] XmlWriterSettings xmlWriterSettings) [NotNull] XmlWriterSettings xmlWriterSettings)
{ {
return XmlWriter.Create( return XmlWriter.Create(

View File

@ -31,7 +31,8 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives
} }
// Internal for unit testing // Internal for unit testing
internal DefaultChunkTreeCache(IFileProvider fileProvider, internal DefaultChunkTreeCache(
IFileProvider fileProvider,
MemoryCacheOptions options) MemoryCacheOptions options)
{ {
_fileProvider = fileProvider; _fileProvider = fileProvider;

View File

@ -12,7 +12,8 @@ namespace Microsoft.AspNet.Mvc.Razor
{ {
private readonly string _injectAttribute; private readonly string _injectAttribute;
public InjectChunkVisitor(CSharpCodeWriter writer, public InjectChunkVisitor(
CSharpCodeWriter writer,
CodeGeneratorContext context, CodeGeneratorContext context,
string injectAttributeName) string injectAttributeName)
: base(writer, context) : base(writer, context)

View File

@ -10,7 +10,8 @@ namespace Microsoft.AspNet.Mvc.Razor
{ {
public abstract class MvcCSharpChunkVisitor : CodeVisitor<CSharpCodeWriter> public abstract class MvcCSharpChunkVisitor : CodeVisitor<CSharpCodeWriter>
{ {
public MvcCSharpChunkVisitor(CSharpCodeWriter writer, public MvcCSharpChunkVisitor(
CSharpCodeWriter writer,
CodeGeneratorContext context) CodeGeneratorContext context)
: base(writer, context) : base(writer, context)
{ {

View File

@ -49,11 +49,6 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation
IDictionary<string, Type> precompiledViews) IDictionary<string, Type> precompiledViews)
: this(fileProvider) : this(fileProvider)
{ {
if (fileProvider == null)
{
throw new ArgumentNullException(nameof(fileProvider));
}
if (precompiledViews == null) if (precompiledViews == null)
{ {
throw new ArgumentNullException(nameof(precompiledViews)); throw new ArgumentNullException(nameof(precompiledViews));

View File

@ -331,7 +331,8 @@ namespace Microsoft.AspNet.Mvc.Razor.Precompilation
private class PrecompileRazorFileInfoCollection : RazorFileInfoCollection private class PrecompileRazorFileInfoCollection : RazorFileInfoCollection
{ {
public PrecompileRazorFileInfoCollection(string assemblyResourceName, public PrecompileRazorFileInfoCollection(
string assemblyResourceName,
string symbolsResourceName, string symbolsResourceName,
IReadOnlyList<RazorFileInfo> fileInfos) IReadOnlyList<RazorFileInfo> fileInfos)
{ {

View File

@ -81,11 +81,6 @@ namespace Microsoft.AspNet.Mvc.Razor
throw new ArgumentNullException(nameof(context)); throw new ArgumentNullException(nameof(context));
} }
if (context == null)
{
throw new ArgumentNullException(nameof(context));
}
_pageExecutionFeature = context.HttpContext.Features.Get<IPageExecutionListenerFeature>(); _pageExecutionFeature = context.HttpContext.Features.Get<IPageExecutionListenerFeature>();
// Partials don't execute _ViewStart pages, but may execute Layout pages if the Layout property // Partials don't execute _ViewStart pages, but may execute Layout pages if the Layout property

View File

@ -22,7 +22,8 @@ namespace Microsoft.AspNet.Mvc
{ {
} }
private static void ConfigureRazor(RazorViewEngineOptions razorOptions, private static void ConfigureRazor(
RazorViewEngineOptions razorOptions,
IApplicationEnvironment applicationEnvironment) IApplicationEnvironment applicationEnvironment)
{ {
razorOptions.FileProvider = new PhysicalFileProvider(applicationEnvironment.ApplicationBasePath); razorOptions.FileProvider = new PhysicalFileProvider(applicationEnvironment.ApplicationBasePath);

View File

@ -30,11 +30,6 @@ namespace Microsoft.AspNet.Mvc.Razor
throw new ArgumentNullException(nameof(foundLocation)); throw new ArgumentNullException(nameof(foundLocation));
} }
if (searchedLocations == null)
{
throw new ArgumentNullException(nameof(searchedLocations));
}
ViewLocation = foundLocation; ViewLocation = foundLocation;
SearchedLocations = searchedLocations; SearchedLocations = searchedLocations;
IsFoundResult = true; IsFoundResult = true;

View File

@ -17,7 +17,8 @@ namespace Microsoft.AspNet.Mvc.Razor
/// <param name="actionContext">The <see cref="Mvc.ActionContext"/> for the current executing action.</param> /// <param name="actionContext">The <see cref="Mvc.ActionContext"/> for the current executing action.</param>
/// <param name="viewName">The view name.</param> /// <param name="viewName">The view name.</param>
/// <param name="isPartial">Determines if the view being discovered is a partial.</param> /// <param name="isPartial">Determines if the view being discovered is a partial.</param>
public ViewLocationExpanderContext(ActionContext actionContext, public ViewLocationExpanderContext(
ActionContext actionContext,
string viewName, string viewName,
bool isPartial) bool isPartial)
{ {

View File

@ -237,7 +237,8 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
return options; return options;
} }
private static void AddStringCollectionKey(StringBuilder builder, private static void AddStringCollectionKey(
StringBuilder builder,
string keyName, string keyName,
string value, string value,
IReadableStringCollection sourceCollection) IReadableStringCollection sourceCollection)

View File

@ -570,7 +570,9 @@ namespace Microsoft.AspNet.Mvc
/// <param name="routeValues">The parameters for a route.</param> /// <param name="routeValues">The parameters for a route.</param>
/// <returns>The created <see cref="RedirectToActionResult"/> for the response.</returns> /// <returns>The created <see cref="RedirectToActionResult"/> for the response.</returns>
[NonAction] [NonAction]
public virtual RedirectToActionResult RedirectToAction(string actionName, string controllerName, public virtual RedirectToActionResult RedirectToAction(
string actionName,
string controllerName,
object routeValues) object routeValues)
{ {
return new RedirectToActionResult(actionName, controllerName, PropertyHelper.ObjectToDictionary(routeValues)) return new RedirectToActionResult(actionName, controllerName, PropertyHelper.ObjectToDictionary(routeValues))
@ -627,7 +629,9 @@ namespace Microsoft.AspNet.Mvc
/// <param name="routeValues">The parameters for a route.</param> /// <param name="routeValues">The parameters for a route.</param>
/// <returns>The created <see cref="RedirectToActionResult"/> for the response.</returns> /// <returns>The created <see cref="RedirectToActionResult"/> for the response.</returns>
[NonAction] [NonAction]
public virtual RedirectToActionResult RedirectToActionPermanent(string actionName, string controllerName, public virtual RedirectToActionResult RedirectToActionPermanent(
string actionName,
string controllerName,
object routeValues) object routeValues)
{ {
return new RedirectToActionResult( return new RedirectToActionResult(
@ -984,7 +988,8 @@ namespace Microsoft.AspNet.Mvc
/// <param name="value">The content value to format in the entity body.</param> /// <param name="value">The content value to format in the entity body.</param>
/// <returns>The created <see cref="CreatedAtRouteResult"/> for the response.</returns> /// <returns>The created <see cref="CreatedAtRouteResult"/> for the response.</returns>
[NonAction] [NonAction]
public virtual CreatedAtActionResult CreatedAtAction(string actionName, public virtual CreatedAtActionResult CreatedAtAction(
string actionName,
string controllerName, string controllerName,
object routeValues, object routeValues,
object value) object value)

View File

@ -24,20 +24,23 @@ namespace Microsoft.AspNet.Mvc.ViewEngines
public IReadOnlyList<IViewEngine> ViewEngines { get; } public IReadOnlyList<IViewEngine> ViewEngines { get; }
/// <inheritdoc /> /// <inheritdoc />
public ViewEngineResult FindPartialView([NotNull] ActionContext context, public ViewEngineResult FindPartialView(
[NotNull] ActionContext context,
[NotNull] string partialViewName) [NotNull] string partialViewName)
{ {
return FindView(context, partialViewName, partial: true); return FindView(context, partialViewName, partial: true);
} }
/// <inheritdoc /> /// <inheritdoc />
public ViewEngineResult FindView([NotNull] ActionContext context, public ViewEngineResult FindView(
[NotNull] ActionContext context,
[NotNull] string viewName) [NotNull] string viewName)
{ {
return FindView(context, viewName, partial: false); return FindView(context, viewName, partial: false);
} }
private ViewEngineResult FindView(ActionContext context, private ViewEngineResult FindView(
ActionContext context,
string viewName, string viewName,
bool partial) bool partial)
{ {

View File

@ -25,7 +25,8 @@ namespace Microsoft.AspNet.Mvc.ViewEngines
get { return View != null; } get { return View != null; }
} }
public static ViewEngineResult NotFound([NotNull] string viewName, public static ViewEngineResult NotFound(
[NotNull] string viewName,
[NotNull] IEnumerable<string> searchedLocations) [NotNull] IEnumerable<string> searchedLocations)
{ {
return new ViewEngineResult return new ViewEngineResult

View File

@ -283,7 +283,8 @@ namespace Microsoft.AspNet.Mvc.ViewFeatures
} }
/// <inheritdoc /> /// <inheritdoc />
public IHtmlContent Display(string expression, public IHtmlContent Display(
string expression,
string templateName, string templateName,
string htmlFieldName, string htmlFieldName,
object additionalViewData) object additionalViewData)

View File

@ -23,7 +23,8 @@ namespace Microsoft.AspNet.Mvc.ViewFeatures.Internal
private bool _readOnly; private bool _readOnly;
private object _additionalViewData; private object _additionalViewData;
public TemplateBuilder([NotNull] IViewEngine viewEngine, public TemplateBuilder(
[NotNull] IViewEngine viewEngine,
[NotNull] ViewContext viewContext, [NotNull] ViewContext viewContext,
[NotNull] ViewDataDictionary viewData, [NotNull] ViewDataDictionary viewData,
[NotNull] ModelExplorer modelExplorer, [NotNull] ModelExplorer modelExplorer,

View File

@ -45,8 +45,10 @@ namespace Microsoft.AspNet.Mvc.ViewFeatures
return results; return results;
} }
private static void ValidateUnobtrusiveValidationRule(ModelClientValidationRule rule, private static void ValidateUnobtrusiveValidationRule(
IDictionary<string, object> resultsDictionary, string dictionaryKey) ModelClientValidationRule rule,
IDictionary<string, object> resultsDictionary,
string dictionaryKey)
{ {
if (string.IsNullOrEmpty(rule.ValidationType)) if (string.IsNullOrEmpty(rule.ValidationType))
{ {

View File

@ -28,7 +28,8 @@ namespace Microsoft.AspNet.Mvc.ViewFeatures
/// </param> /// </param>
/// <param name="modelState"><see cref="ModelStateDictionary"/> instance for this scope.</param> /// <param name="modelState"><see cref="ModelStateDictionary"/> instance for this scope.</param>
/// <remarks>For use when creating a <see cref="ViewDataDictionary"/> for a new top-level scope.</remarks> /// <remarks>For use when creating a <see cref="ViewDataDictionary"/> for a new top-level scope.</remarks>
public ViewDataDictionary([NotNull] IModelMetadataProvider metadataProvider, public ViewDataDictionary(
[NotNull] IModelMetadataProvider metadataProvider,
[NotNull] ModelStateDictionary modelState) [NotNull] ModelStateDictionary modelState)
: this(metadataProvider, modelState, declaredModelType: typeof(object)) : this(metadataProvider, modelState, declaredModelType: typeof(object))
{ {

View File

@ -28,7 +28,8 @@ namespace Microsoft.AspNet.Mvc.ViewFeatures
/// <param name="viewData">The <see cref="ViewDataDictionary"/> for the view being rendered.</param> /// <param name="viewData">The <see cref="ViewDataDictionary"/> for the view being rendered.</param>
/// <param name="tempData">The <see cref="ITempDataDictionary"/> for the view being rendered.</param> /// <param name="tempData">The <see cref="ITempDataDictionary"/> for the view being rendered.</param>
/// <returns>A <see cref="Task"/> that represents the asynchronous rendering.</returns> /// <returns>A <see cref="Task"/> that represents the asynchronous rendering.</returns>
public static async Task ExecuteAsync([NotNull] IView view, public static async Task ExecuteAsync(
[NotNull] IView view,
[NotNull] ActionContext actionContext, [NotNull] ActionContext actionContext,
[NotNull] ViewDataDictionary viewData, [NotNull] ViewDataDictionary viewData,
[NotNull] ITempDataDictionary tempData, [NotNull] ITempDataDictionary tempData,

View File

@ -40,7 +40,8 @@ namespace System.Net.Http.Formatting
/// <param name="stringWithQuality1">The first value to compare.</param> /// <param name="stringWithQuality1">The first value to compare.</param>
/// <param name="stringWithQuality2">The second value to compare</param> /// <param name="stringWithQuality2">The second value to compare</param>
/// <returns>The result of the comparison.</returns> /// <returns>The result of the comparison.</returns>
public int Compare(StringWithQualityHeaderValue stringWithQuality1, public int Compare(
StringWithQualityHeaderValue stringWithQuality1,
StringWithQualityHeaderValue stringWithQuality2) StringWithQualityHeaderValue stringWithQuality2)
{ {
Debug.Assert(stringWithQuality1 != null); Debug.Assert(stringWithQuality1 != null);

View File

@ -33,7 +33,8 @@ namespace Microsoft.AspNet.Mvc.Formatters
[Theory] [Theory]
[MemberData(nameof(OutputFormatterContextValues_CanWriteType))] [MemberData(nameof(OutputFormatterContextValues_CanWriteType))]
public void CanWriteResult_ByDefault_ReturnsTrue_IfTheValueIsNull(object value, public void CanWriteResult_ByDefault_ReturnsTrue_IfTheValueIsNull(
object value,
bool declaredTypeAsString, bool declaredTypeAsString,
bool expectedCanwriteResult, bool expectedCanwriteResult,
bool useNonNullContentType) bool useNonNullContentType)

View File

@ -42,7 +42,8 @@ namespace Microsoft.AspNet.Mvc.Formatters
[Theory] [Theory]
[MemberData(nameof(SelectResponseCharacterEncodingData))] [MemberData(nameof(SelectResponseCharacterEncodingData))]
public void SelectResponseCharacterEncoding_SelectsEncoding(string acceptCharsetHeaders, public void SelectResponseCharacterEncoding_SelectsEncoding(
string acceptCharsetHeaders,
string requestEncoding, string requestEncoding,
string[] supportedEncodings, string[] supportedEncodings,
string expectedEncoding) string expectedEncoding)

View File

@ -45,7 +45,8 @@ namespace Microsoft.AspNet.Mvc
[Theory] [Theory]
[InlineData("", "/Home/About", "/Home/About")] [InlineData("", "/Home/About", "/Home/About")]
[InlineData("/myapproot", "/test", "/test")] [InlineData("/myapproot", "/test", "/test")]
public void Execute_ReturnsContentPath_WhenItDoesNotStartWithTilde(string appRoot, public void Execute_ReturnsContentPath_WhenItDoesNotStartWithTilde(
string appRoot,
string contentPath, string contentPath,
string expectedPath) string expectedPath)
{ {
@ -72,7 +73,8 @@ namespace Microsoft.AspNet.Mvc
[InlineData("/", "~/", "/")] [InlineData("/", "~/", "/")]
[InlineData("", "~/Home/About", "/Home/About")] [InlineData("", "~/Home/About", "/Home/About")]
[InlineData("/myapproot", "~/", "/myapproot/")] [InlineData("/myapproot", "~/", "/myapproot/")]
public void Execute_ReturnsAppRelativePath_WhenItStartsWithTilde(string appRoot, public void Execute_ReturnsAppRelativePath_WhenItStartsWithTilde(
string appRoot,
string contentPath, string contentPath,
string expectedPath) string expectedPath)
{ {
@ -110,7 +112,8 @@ namespace Microsoft.AspNet.Mvc
return serviceCollection.BuildServiceProvider(); return serviceCollection.BuildServiceProvider();
} }
private static HttpContext GetHttpContext(string appRoot, private static HttpContext GetHttpContext(
string appRoot,
string contentPath, string contentPath,
string expectedPath, string expectedPath,
HttpResponse response) HttpResponse response)

View File

@ -25,7 +25,8 @@ namespace Microsoft.AspNet.Mvc.Routing
[InlineData("/myapproot", null, null)] [InlineData("/myapproot", null, null)]
[InlineData("", "/Home/About", "/Home/About")] [InlineData("", "/Home/About", "/Home/About")]
[InlineData("/myapproot", "/test", "/test")] [InlineData("/myapproot", "/test", "/test")]
public void Content_ReturnsContentPath_WhenItDoesNotStartWithToken(string appRoot, public void Content_ReturnsContentPath_WhenItDoesNotStartWithToken(
string appRoot,
string contentPath, string contentPath,
string expectedPath) string expectedPath)
{ {
@ -49,7 +50,8 @@ namespace Microsoft.AspNet.Mvc.Routing
[InlineData("", "~/Home/About", "/Home/About")] [InlineData("", "~/Home/About", "/Home/About")]
[InlineData("/", "~", "/")] [InlineData("/", "~", "/")]
[InlineData("/myapproot", "~/Content/bootstrap.css", "/myapproot/Content/bootstrap.css")] [InlineData("/myapproot", "~/Content/bootstrap.css", "/myapproot/Content/bootstrap.css")]
public void Content_ReturnsAppRelativePath_WhenItStartsWithToken(string appRoot, public void Content_ReturnsAppRelativePath_WhenItStartsWithToken(
string appRoot,
string contentPath, string contentPath,
string expectedPath) string expectedPath)
{ {

View File

@ -598,7 +598,9 @@ namespace Microsoft.AspNet.Mvc.Formatters.Xml
XmlAssert.Equal(expectedOutput, content); XmlAssert.Equal(expectedOutput, content);
} }
private OutputFormatterContext GetOutputFormatterContext(object outputValue, Type outputType, private OutputFormatterContext GetOutputFormatterContext(
object outputValue,
Type outputType,
string contentType = "application/xml; charset=utf-8") string contentType = "application/xml; charset=utf-8")
{ {
return new OutputFormatterContext return new OutputFormatterContext

View File

@ -64,7 +64,8 @@ namespace Microsoft.AspNet.Mvc.Razor
[InlineData("Foo?", "Foo?")] [InlineData("Foo?", "Foo?")]
[InlineData("Foo[[]][]", "Foo[[]][]")] [InlineData("Foo[[]][]", "Foo[[]][]")]
[InlineData("$rootnamespace$.MyModel", "$rootnamespace$.MyModel")] [InlineData("$rootnamespace$.MyModel", "$rootnamespace$.MyModel")]
public void ParseModelKeyword_InfersBaseType_FromModelName(string modelName, public void ParseModelKeyword_InfersBaseType_FromModelName(
string modelName,
string expectedModel) string expectedModel)
{ {
// Arrange // Arrange
@ -270,7 +271,8 @@ namespace Microsoft.AspNet.Mvc.Razor
[InlineData(" Microsoft.AspNet.Mvc.IHtmlHelper<MyNullableModel[]?> MyHelper ", [InlineData(" Microsoft.AspNet.Mvc.IHtmlHelper<MyNullableModel[]?> MyHelper ",
"Microsoft.AspNet.Mvc.IHtmlHelper<MyNullableModel[]?>", "MyHelper")] "Microsoft.AspNet.Mvc.IHtmlHelper<MyNullableModel[]?>", "MyHelper")]
[InlineData(" TestService @class ", "TestService", "@class")] [InlineData(" TestService @class ", "TestService", "@class")]
public void ParseInjectKeyword_InfersTypeAndPropertyName(string injectStatement, public void ParseInjectKeyword_InfersTypeAndPropertyName(
string injectStatement,
string expectedService, string expectedService,
string expectedPropertyName) string expectedPropertyName)
{ {
@ -348,7 +350,8 @@ namespace Microsoft.AspNet.Mvc.Razor
[Theory] [Theory]
[InlineData("IMyService Service ", "IMyService", "Service")] [InlineData("IMyService Service ", "IMyService", "Service")]
[InlineData(" TestService @namespace ", "TestService", "@namespace")] [InlineData(" TestService @namespace ", "TestService", "@namespace")]
public void ParseInjectKeyword_ParsesUpToNewLine(string injectStatement, public void ParseInjectKeyword_ParsesUpToNewLine(
string injectStatement,
string expectedService, string expectedService,
string expectedPropertyName) string expectedPropertyName)
{ {
@ -514,7 +517,8 @@ namespace Microsoft.AspNet.Mvc.Razor
Assert.Equal(expectedErrors, errors); Assert.Equal(expectedErrors, errors);
} }
private static List<Span> ParseDocument(string documentContents, private static List<Span> ParseDocument(
string documentContents,
List<RazorError> errors = null, List<RazorError> errors = null,
List<LineMapping> lineMappings = null) List<LineMapping> lineMappings = null)
{ {

View File

@ -234,7 +234,8 @@ namespace Microsoft.AspNet.Mvc.Razor
private class TestableMvcRazorParser : MvcRazorParser private class TestableMvcRazorParser : MvcRazorParser
{ {
public TestableMvcRazorParser(RazorParser parser, public TestableMvcRazorParser(
RazorParser parser,
IReadOnlyList<ChunkTree> chunkTrees, IReadOnlyList<ChunkTree> chunkTrees,
IReadOnlyList<Chunk> defaultInheritedChunks) IReadOnlyList<Chunk> defaultInheritedChunks)
: base(parser, chunkTrees, defaultInheritedChunks, typeof(ModelExpression).FullName) : base(parser, chunkTrees, defaultInheritedChunks, typeof(ModelExpression).FullName)

View File

@ -14,7 +14,8 @@ namespace Microsoft.AspNet.Mvc.Razor
[Theory] [Theory]
[InlineData("SomeType", "SomeType", "SomeMethod(__model => __model.MyValue)")] [InlineData("SomeType", "SomeType", "SomeMethod(__model => __model.MyValue)")]
[InlineData("SomeType", "SomeType2", "MyValue")] [InlineData("SomeType", "SomeType2", "MyValue")]
public void RenderAttributeValue_RendersModelExpressionsCorrectly(string modelExpressionType, public void RenderAttributeValue_RendersModelExpressionsCorrectly(
string modelExpressionType,
string propertyType, string propertyType,
string expectedValue) string expectedValue)
{ {

View File

@ -700,7 +700,7 @@ namespace Microsoft.AspNet.Mvc.Razor
p.WriteAttribute("href", p.WriteAttribute("href",
new PositionTagged<string>("prefix", 0), new PositionTagged<string>("prefix", 0),
new PositionTagged<string>("suffix", 10), new PositionTagged<string>("suffix", 10),
new AttributeValue(new PositionTagged<string>("", 6), new AttributeValue(new PositionTagged<string>(string.Empty, 6),
new PositionTagged<object>("true", 6), new PositionTagged<object>("true", 6),
literal: false)); literal: false));
}); });
@ -756,7 +756,7 @@ namespace Microsoft.AspNet.Mvc.Razor
{ {
new AttributeValue[] { new AttributeValue[] {
new AttributeValue( new AttributeValue(
new PositionTagged<string>("", 9), new PositionTagged<string>(string.Empty, 9),
new PositionTagged<object>("Hello", 9), new PositionTagged<object>("Hello", 9),
literal: true) literal: true)
}, },
@ -778,7 +778,7 @@ namespace Microsoft.AspNet.Mvc.Razor
new PositionTagged<object>(null, 10), new PositionTagged<object>(null, 10),
literal: false) literal: false)
}, },
"" string.Empty
}, },
{ {
new AttributeValue[] { new AttributeValue[] {
@ -806,7 +806,7 @@ namespace Microsoft.AspNet.Mvc.Razor
{ {
new AttributeValue[] { new AttributeValue[] {
new AttributeValue( new AttributeValue(
new PositionTagged<string>("", 9), new PositionTagged<string>(string.Empty, 9),
new PositionTagged<object>("prefix", 9), new PositionTagged<object>("prefix", 9),
literal: true), literal: true),
new AttributeValue( new AttributeValue(
@ -859,7 +859,7 @@ namespace Microsoft.AspNet.Mvc.Razor
} }
[Theory] [Theory]
[InlineData(null, "")] [InlineData(null, string.Empty)]
[InlineData(false, "False")] [InlineData(false, "False")]
public void AddHtmlAttributeValues_OnlyAddsToAllAttributesWhenAttributeRemoved( public void AddHtmlAttributeValues_OnlyAddsToAllAttributesWhenAttributeRemoved(
object attributeValue, object attributeValue,
@ -939,7 +939,7 @@ namespace Microsoft.AspNet.Mvc.Razor
{ {
new AttributeValue[] { new AttributeValue[] {
new AttributeValue( new AttributeValue(
new PositionTagged<string>("", 9), new PositionTagged<string>(string.Empty, 9),
new PositionTagged<object>(true, 9), new PositionTagged<object>(true, 9),
literal: false) literal: false)
}, },
@ -948,20 +948,20 @@ namespace Microsoft.AspNet.Mvc.Razor
{ {
new AttributeValue[] { new AttributeValue[] {
new AttributeValue( new AttributeValue(
new PositionTagged<string>("", 9), new PositionTagged<string>(string.Empty, 9),
new PositionTagged<object>(false, 9), new PositionTagged<object>(false, 9),
literal: false) literal: false)
}, },
"" string.Empty
}, },
{ {
new AttributeValue[] { new AttributeValue[] {
new AttributeValue( new AttributeValue(
new PositionTagged<string>("", 9), new PositionTagged<string>(string.Empty, 9),
new PositionTagged<object>(null, 9), new PositionTagged<object>(null, 9),
literal: false) literal: false)
}, },
"" string.Empty
}, },
{ {
new AttributeValue[] { new AttributeValue[] {
@ -1007,7 +1007,7 @@ namespace Microsoft.AspNet.Mvc.Razor
page.HtmlEncoder = new CommonTestEncoder(); page.HtmlEncoder = new CommonTestEncoder();
var writer = new StringWriter(); var writer = new StringWriter();
var prefix = new PositionTagged<string>("someattr=", 0); var prefix = new PositionTagged<string>("someattr=", 0);
var suffix = new PositionTagged<string>("", 0); var suffix = new PositionTagged<string>(string.Empty, 0);
// Act // Act
page.WriteAttributeTo(writer, "someattr", prefix, suffix, attributeValues); page.WriteAttributeTo(writer, "someattr", prefix, suffix, attributeValues);
@ -1059,7 +1059,7 @@ namespace Microsoft.AspNet.Mvc.Razor
}, },
{ {
GetTagHelperOutput( GetTagHelperOutput(
tagName: "", tagName: string.Empty,
attributes: new TagHelperAttributeList(), attributes: new TagHelperAttributeList(),
tagMode: TagMode.StartTagAndEndTag, tagMode: TagMode.StartTagAndEndTag,
preElement: null, preElement: null,
@ -1358,7 +1358,7 @@ namespace Microsoft.AspNet.Mvc.Razor
}, },
{ {
GetTagHelperOutput( GetTagHelperOutput(
tagName: "", tagName: string.Empty,
attributes: new TagHelperAttributeList(), attributes: new TagHelperAttributeList(),
tagMode: TagMode.StartTagAndEndTag, tagMode: TagMode.StartTagAndEndTag,
preElement: "Before", preElement: "Before",
@ -1370,7 +1370,7 @@ namespace Microsoft.AspNet.Mvc.Razor
}, },
{ {
GetTagHelperOutput( GetTagHelperOutput(
tagName: "", tagName: string.Empty,
attributes: new TagHelperAttributeList { { "test", "testVal" } }, attributes: new TagHelperAttributeList { { "test", "testVal" } },
tagMode: TagMode.SelfClosing, tagMode: TagMode.SelfClosing,
preElement: "Before", preElement: "Before",
@ -1406,7 +1406,7 @@ namespace Microsoft.AspNet.Mvc.Razor
}, },
{ {
GetTagHelperOutput( GetTagHelperOutput(
tagName: "", tagName: string.Empty,
attributes: new TagHelperAttributeList { { "test", "testVal" } }, attributes: new TagHelperAttributeList { { "test", "testVal" } },
tagMode: TagMode.StartTagOnly, tagMode: TagMode.StartTagOnly,
preElement: "Before", preElement: "Before",
@ -1454,7 +1454,7 @@ namespace Microsoft.AspNet.Mvc.Razor
}, },
{ {
GetTagHelperOutput( GetTagHelperOutput(
tagName: "", tagName: string.Empty,
attributes: new TagHelperAttributeList(), attributes: new TagHelperAttributeList(),
tagMode: TagMode.StartTagAndEndTag, tagMode: TagMode.StartTagAndEndTag,
preElement: null, preElement: null,
@ -1466,7 +1466,7 @@ namespace Microsoft.AspNet.Mvc.Razor
}, },
{ {
GetTagHelperOutput( GetTagHelperOutput(
tagName: "", tagName: string.Empty,
attributes: new TagHelperAttributeList { { "test", "testVal" } }, attributes: new TagHelperAttributeList { { "test", "testVal" } },
tagMode: TagMode.SelfClosing, tagMode: TagMode.SelfClosing,
preElement: null, preElement: null,
@ -1502,7 +1502,7 @@ namespace Microsoft.AspNet.Mvc.Razor
}, },
{ {
GetTagHelperOutput( GetTagHelperOutput(
tagName: "", tagName: string.Empty,
attributes: new TagHelperAttributeList { { "test", "testVal" } }, attributes: new TagHelperAttributeList { { "test", "testVal" } },
tagMode: TagMode.StartTagOnly, tagMode: TagMode.StartTagOnly,
preElement: null, preElement: null,
@ -1574,7 +1574,7 @@ namespace Microsoft.AspNet.Mvc.Razor
}, },
{ {
GetTagHelperOutput( GetTagHelperOutput(
tagName: "", tagName: string.Empty,
attributes: new TagHelperAttributeList(), attributes: new TagHelperAttributeList(),
tagMode: TagMode.SelfClosing, tagMode: TagMode.SelfClosing,
preElement: "Before", preElement: "Before",
@ -1598,7 +1598,7 @@ namespace Microsoft.AspNet.Mvc.Razor
}, },
{ {
GetTagHelperOutput( GetTagHelperOutput(
tagName: "", tagName: string.Empty,
attributes: new TagHelperAttributeList(), attributes: new TagHelperAttributeList(),
tagMode: TagMode.StartTagOnly, tagMode: TagMode.StartTagOnly,
preElement: "Before", preElement: "Before",
@ -1610,7 +1610,7 @@ namespace Microsoft.AspNet.Mvc.Razor
}, },
{ {
GetTagHelperOutput( GetTagHelperOutput(
tagName: "", tagName: string.Empty,
attributes: new TagHelperAttributeList(), attributes: new TagHelperAttributeList(),
tagMode: TagMode.StartTagAndEndTag, tagMode: TagMode.StartTagAndEndTag,
preElement: "Before", preElement: "Before",
@ -1622,7 +1622,7 @@ namespace Microsoft.AspNet.Mvc.Razor
}, },
{ {
GetTagHelperOutput( GetTagHelperOutput(
tagName: "", tagName: string.Empty,
attributes: new TagHelperAttributeList { { "test", "testVal" } }, attributes: new TagHelperAttributeList { { "test", "testVal" } },
tagMode: TagMode.StartTagAndEndTag, tagMode: TagMode.StartTagAndEndTag,
preElement: "Before", preElement: "Before",

View File

@ -338,7 +338,8 @@ namespace Microsoft.AspNet.Mvc.Razor.Test
[Theory] [Theory]
[MemberData(nameof(ViewLocationExpanderTestData))] [MemberData(nameof(ViewLocationExpanderTestData))]
public void FindView_UsesViewLocationExpandersToLocateViews(IDictionary<string, object> routeValues, public void FindView_UsesViewLocationExpandersToLocateViews(
IDictionary<string, object> routeValues,
IEnumerable<string> expectedSeeds) IEnumerable<string> expectedSeeds)
{ {
// Arrange // Arrange
@ -589,7 +590,8 @@ namespace Microsoft.AspNet.Mvc.Razor.Test
[Theory] [Theory]
[MemberData(nameof(ViewLocationExpanderTestData))] [MemberData(nameof(ViewLocationExpanderTestData))]
public void FindPage_UsesViewLocationExpander_ToExpandPaths(IDictionary<string, object> routeValues, public void FindPage_UsesViewLocationExpander_ToExpandPaths(
IDictionary<string, object> routeValues,
IEnumerable<string> expectedSeeds) IEnumerable<string> expectedSeeds)
{ {
// Arrange // Arrange
@ -1082,7 +1084,8 @@ namespace Microsoft.AspNet.Mvc.Razor.Test
} }
} }
private RazorViewEngine CreateViewEngine(IRazorPageFactory pageFactory = null, private RazorViewEngine CreateViewEngine(
IRazorPageFactory pageFactory = null,
IRazorViewFactory viewFactory = null, IRazorViewFactory viewFactory = null,
IEnumerable<IViewLocationExpander> expanders = null, IEnumerable<IViewLocationExpander> expanders = null,
IViewLocationCache cache = null) IViewLocationCache cache = null)
@ -1176,7 +1179,8 @@ namespace Microsoft.AspNet.Mvc.Razor.Test
private class OverloadedLocationViewEngine : RazorViewEngine private class OverloadedLocationViewEngine : RazorViewEngine
{ {
public OverloadedLocationViewEngine(IRazorPageFactory pageFactory, public OverloadedLocationViewEngine(
IRazorPageFactory pageFactory,
IRazorViewFactory viewFactory, IRazorViewFactory viewFactory,
IOptions<RazorViewEngineOptions> optionsAccessor, IOptions<RazorViewEngineOptions> optionsAccessor,
IViewLocationCache cache) IViewLocationCache cache)

View File

@ -777,7 +777,8 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
new HtmlHelperOptions()); new HtmlHelperOptions());
} }
private static TagHelperContext GetTagHelperContext(string id = "testid", private static TagHelperContext GetTagHelperContext(
string id = "testid",
string childContent = "some child content") string childContent = "some child content")
{ {
return new TagHelperContext( return new TagHelperContext(

View File

@ -233,7 +233,8 @@ namespace Microsoft.AspNet.Mvc.TagHelpers
public class TagHelperOutputContent public class TagHelperOutputContent
{ {
public TagHelperOutputContent(string originalChildContent, public TagHelperOutputContent(
string originalChildContent,
string outputContent, string outputContent,
string expectedContent, string expectedContent,
string expectedId) string expectedId)

View File

@ -41,7 +41,8 @@ namespace Microsoft.AspNet.Mvc.Rendering
[Theory] [Theory]
[MemberData(nameof(PasswordWithViewDataAndAttributesData))] [MemberData(nameof(PasswordWithViewDataAndAttributesData))]
public void Password_UsesAttributeValueWhenValueArgumentIsNull(ViewDataDictionary<PasswordModel> vdd, public void Password_UsesAttributeValueWhenValueArgumentIsNull(
ViewDataDictionary<PasswordModel> vdd,
object attributes) object attributes)
{ {
// Arrange // Arrange
@ -58,7 +59,8 @@ namespace Microsoft.AspNet.Mvc.Rendering
[Theory] [Theory]
[MemberData(nameof(PasswordWithViewDataAndAttributesData))] [MemberData(nameof(PasswordWithViewDataAndAttributesData))]
public void Password_UsesExplicitValue_IfSpecified(ViewDataDictionary<PasswordModel> vdd, public void Password_UsesExplicitValue_IfSpecified(
ViewDataDictionary<PasswordModel> vdd,
object attributes) object attributes)
{ {
// Arrange // Arrange
@ -219,7 +221,8 @@ namespace Microsoft.AspNet.Mvc.Rendering
[Theory] [Theory]
[MemberData(nameof(PasswordWithViewDataAndAttributesData))] [MemberData(nameof(PasswordWithViewDataAndAttributesData))]
public void PasswordForWithAttributes_GeneratesExpectedValue(ViewDataDictionary<PasswordModel> vdd, public void PasswordForWithAttributes_GeneratesExpectedValue(
ViewDataDictionary<PasswordModel> vdd,
object htmlAttributes) object htmlAttributes)
{ {
// Arrange // Arrange

View File

@ -137,7 +137,8 @@ namespace Microsoft.AspNet.Mvc.Rendering
[Theory] [Theory]
[MemberData(nameof(IgnoreCaseTestData))] [MemberData(nameof(IgnoreCaseTestData))]
public void AnonymousObjectToHtmlAttributes_IgnoresPropertyCase(object htmlAttributeObject, public void AnonymousObjectToHtmlAttributes_IgnoresPropertyCase(
object htmlAttributeObject,
KeyValuePair<string, object> expectedEntry) KeyValuePair<string, object> expectedEntry)
{ {
// Act // Act

View File

@ -792,7 +792,8 @@ namespace Microsoft.AspNet.Mvc.ViewFeatures
private class TestViewDataDictionary : ViewDataDictionary private class TestViewDataDictionary : ViewDataDictionary
{ {
public TestViewDataDictionary(IModelMetadataProvider modelMetadataProvider, public TestViewDataDictionary(
IModelMetadataProvider modelMetadataProvider,
ModelStateDictionary modelState) ModelStateDictionary modelState)
: base(modelMetadataProvider, modelState) : base(modelMetadataProvider, modelState)
{ {

View File

@ -28,38 +28,56 @@ namespace Microsoft.TestCommon
ExtraDataSets = new List<Tuple<Type, string>>(); ExtraDataSets = new List<Tuple<Type, string>>();
} }
public TestDataSetAttribute(Type declaringType, string propertyName, public TestDataSetAttribute(
Type declaringType1, string propertyName1, Type declaringType,
string propertyName,
Type declaringType1,
string propertyName1,
TestDataVariations testDataVariations = TestCommon.TestDataVariations.All) TestDataVariations testDataVariations = TestCommon.TestDataVariations.All)
: this(declaringType, propertyName, testDataVariations) : this(declaringType, propertyName, testDataVariations)
{ {
ExtraDataSets = new List<Tuple<Type, string>> { Tuple.Create(declaringType1, propertyName1) }; ExtraDataSets = new List<Tuple<Type, string>> { Tuple.Create(declaringType1, propertyName1) };
} }
public TestDataSetAttribute(Type declaringType, string propertyName, public TestDataSetAttribute(
Type declaringType1, string propertyName1, Type declaringType,
Type declaringType2, string propertyName2, string propertyName,
Type declaringType1,
string propertyName1,
Type declaringType2,
string propertyName2,
TestDataVariations testDataVariations = TestCommon.TestDataVariations.All) TestDataVariations testDataVariations = TestCommon.TestDataVariations.All)
: this(declaringType, propertyName, testDataVariations) : this(declaringType, propertyName, testDataVariations)
{ {
ExtraDataSets = new List<Tuple<Type, string>> { Tuple.Create(declaringType1, propertyName1), Tuple.Create(declaringType2, propertyName2) }; ExtraDataSets = new List<Tuple<Type, string>> { Tuple.Create(declaringType1, propertyName1), Tuple.Create(declaringType2, propertyName2) };
} }
public TestDataSetAttribute(Type declaringType, string propertyName, public TestDataSetAttribute(
Type declaringType1, string propertyName1, Type declaringType,
Type declaringType2, string propertyName2, string propertyName,
Type declaringType3, string propertyName3, Type declaringType1,
string propertyName1,
Type declaringType2,
string propertyName2,
Type declaringType3,
string propertyName3,
TestDataVariations testDataVariations = TestCommon.TestDataVariations.All) TestDataVariations testDataVariations = TestCommon.TestDataVariations.All)
: this(declaringType, propertyName, testDataVariations) : this(declaringType, propertyName, testDataVariations)
{ {
ExtraDataSets = new List<Tuple<Type, string>> { Tuple.Create(declaringType1, propertyName1), Tuple.Create(declaringType2, propertyName2), Tuple.Create(declaringType3, propertyName3) }; ExtraDataSets = new List<Tuple<Type, string>> { Tuple.Create(declaringType1, propertyName1), Tuple.Create(declaringType2, propertyName2), Tuple.Create(declaringType3, propertyName3) };
} }
public TestDataSetAttribute(Type declaringType, string propertyName, public TestDataSetAttribute(
Type declaringType1, string propertyName1, Type declaringType,
Type declaringType2, string propertyName2, string propertyName,
Type declaringType3, string propertyName3, Type declaringType1,
Type declaringType4, string propertyName4, string propertyName1,
Type declaringType2,
string propertyName2,
Type declaringType3,
string propertyName3,
Type declaringType4,
string propertyName4,
TestDataVariations testDataVariations = TestCommon.TestDataVariations.All) TestDataVariations testDataVariations = TestCommon.TestDataVariations.All)
: this(declaringType, propertyName, testDataVariations) : this(declaringType, propertyName, testDataVariations)
{ {