diff --git a/src/Microsoft.AspNet.JsonPatch/Converters/TypedJsonPatchDocumentConverter.cs b/src/Microsoft.AspNet.JsonPatch/Converters/TypedJsonPatchDocumentConverter.cs index 5f0eb8ac09..7b6bb77e17 100644 --- a/src/Microsoft.AspNet.JsonPatch/Converters/TypedJsonPatchDocumentConverter.cs +++ b/src/Microsoft.AspNet.JsonPatch/Converters/TypedJsonPatchDocumentConverter.cs @@ -13,8 +13,11 @@ using Newtonsoft.Json.Serialization; namespace Microsoft.AspNet.JsonPatch.Converters { 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) { try diff --git a/src/Microsoft.AspNet.JsonPatch/Helpers/ExpandoObjectDictionaryExtensions.cs b/src/Microsoft.AspNet.JsonPatch/Helpers/ExpandoObjectDictionaryExtensions.cs index 127d70bf36..a5911dded2 100644 --- a/src/Microsoft.AspNet.JsonPatch/Helpers/ExpandoObjectDictionaryExtensions.cs +++ b/src/Microsoft.AspNet.JsonPatch/Helpers/ExpandoObjectDictionaryExtensions.cs @@ -9,8 +9,10 @@ namespace Microsoft.AspNet.JsonPatch.Helpers // Helper methods to allow case-insensitive key search internal static class ExpandoObjectDictionaryExtensions { - internal static void SetValueForCaseInsensitiveKey(this IDictionary propertyDictionary, - string key, object value) + internal static void SetValueForCaseInsensitiveKey( + this IDictionary propertyDictionary, + string key, + object value) { foreach (KeyValuePair kvp in propertyDictionary) { @@ -22,8 +24,9 @@ namespace Microsoft.AspNet.JsonPatch.Helpers } } - internal static void RemoveValueForCaseInsensitiveKey(this IDictionary propertyDictionary, - string key) + internal static void RemoveValueForCaseInsensitiveKey( + this IDictionary propertyDictionary, + string key) { string realKey = null; foreach (KeyValuePair kvp in propertyDictionary) @@ -40,9 +43,10 @@ namespace Microsoft.AspNet.JsonPatch.Helpers propertyDictionary.Remove(realKey); } } - - internal static object GetValueForCaseInsensitiveKey(this IDictionary propertyDictionary, - string key) + + internal static object GetValueForCaseInsensitiveKey( + this IDictionary propertyDictionary, + string key) { foreach (KeyValuePair kvp in propertyDictionary) { @@ -51,12 +55,13 @@ namespace Microsoft.AspNet.JsonPatch.Helpers return kvp.Value; } } - + throw new ArgumentException(Resources.FormatDictionaryKeyNotFound(key)); } - - internal static bool ContainsCaseInsensitiveKey(this IDictionary propertyDictionary, - string key) + + internal static bool ContainsCaseInsensitiveKey( + this IDictionary propertyDictionary, + string key) { foreach (KeyValuePair kvp in propertyDictionary) { @@ -65,8 +70,8 @@ namespace Microsoft.AspNet.JsonPatch.Helpers return true; } } - return false; + return false; } } } diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/ModelBinding/Validation/ClientModelValidationContext.cs b/src/Microsoft.AspNet.Mvc.Abstractions/ModelBinding/Validation/ClientModelValidationContext.cs index 55195239c3..719e706a69 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/ModelBinding/Validation/ClientModelValidationContext.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/ModelBinding/Validation/ClientModelValidationContext.cs @@ -8,9 +8,10 @@ namespace Microsoft.AspNet.Mvc.ModelBinding.Validation { public class ClientModelValidationContext { - public ClientModelValidationContext([NotNull] ModelMetadata metadata, - [NotNull] IModelMetadataProvider metadataProvider, - [NotNull] IServiceProvider requestServices) + public ClientModelValidationContext( + [NotNull] ModelMetadata metadata, + [NotNull] IModelMetadataProvider metadataProvider, + [NotNull] IServiceProvider requestServices) { ModelMetadata = metadata; MetadataProvider = metadataProvider; diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/ModelBinding/Validation/ModelClientValidationRule.cs b/src/Microsoft.AspNet.Mvc.Abstractions/ModelBinding/Validation/ModelClientValidationRule.cs index 3d1fbaae34..306576930b 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/ModelBinding/Validation/ModelClientValidationRule.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/ModelBinding/Validation/ModelClientValidationRule.cs @@ -17,8 +17,9 @@ namespace Microsoft.AspNet.Mvc.ModelBinding.Validation { } - public ModelClientValidationRule([NotNull] string validationType, - [NotNull] string errorMessage) + public ModelClientValidationRule( + [NotNull] string validationType, + [NotNull] string errorMessage) { ValidationType = validationType; ErrorMessage = errorMessage; diff --git a/src/Microsoft.AspNet.Mvc.Core/Actions/ControllerActionDescriptorBuilder.cs b/src/Microsoft.AspNet.Mvc.Core/Actions/ControllerActionDescriptorBuilder.cs index 1146896e13..87226da833 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Actions/ControllerActionDescriptorBuilder.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Actions/ControllerActionDescriptorBuilder.cs @@ -802,7 +802,8 @@ namespace Microsoft.AspNet.Mvc.Actions private class MethodToActionMap : Dictionary>> { - public void AddToMethodInfo(ActionModel action, + public void AddToMethodInfo( + ActionModel action, IList actionDescriptors) { IDictionary> actionsForMethod = null; diff --git a/src/Microsoft.AspNet.Mvc.Core/Actions/DefaultControllerTypeProvider.cs b/src/Microsoft.AspNet.Mvc.Core/Actions/DefaultControllerTypeProvider.cs index aa2e27238f..2173725ea5 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Actions/DefaultControllerTypeProvider.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Actions/DefaultControllerTypeProvider.cs @@ -46,8 +46,9 @@ namespace Microsoft.AspNet.Mvc.Actions /// The . /// The set of candidate assemblies. /// true if the is a controller. Otherwise false. - protected internal virtual bool IsController([NotNull] TypeInfo typeInfo, - [NotNull] ISet candidateAssemblies) + protected internal virtual bool IsController( + [NotNull] TypeInfo typeInfo, + [NotNull] ISet candidateAssemblies) { if (!typeInfo.IsClass) { diff --git a/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/ActionModel.cs b/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/ActionModel.cs index 9509e8c93c..5e069aa34b 100644 --- a/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/ActionModel.cs +++ b/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/ActionModel.cs @@ -16,8 +16,9 @@ namespace Microsoft.AspNet.Mvc.ApplicationModels " Route: {AttributeRouteModel?.Template}, Filters: {Filters.Count}")] public class ActionModel { - public ActionModel([NotNull] MethodInfo actionMethod, - [NotNull] IReadOnlyList attributes) + public ActionModel( + [NotNull] MethodInfo actionMethod, + [NotNull] IReadOnlyList attributes) { ActionMethod = actionMethod; diff --git a/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/ControllerModel.cs b/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/ControllerModel.cs index 5ee468d30f..9b1cf90455 100644 --- a/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/ControllerModel.cs +++ b/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/ControllerModel.cs @@ -16,8 +16,9 @@ namespace Microsoft.AspNet.Mvc.ApplicationModels " Routes: {AttributeRoutes.Count}, Filters: {Filters.Count}")] public class ControllerModel { - public ControllerModel([NotNull] TypeInfo controllerType, - [NotNull] IReadOnlyList attributes) + public ControllerModel( + [NotNull] TypeInfo controllerType, + [NotNull] IReadOnlyList attributes) { ControllerType = controllerType; diff --git a/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/ParameterModel.cs b/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/ParameterModel.cs index 795985b58a..d4ecdd9e71 100644 --- a/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/ParameterModel.cs +++ b/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/ParameterModel.cs @@ -12,8 +12,9 @@ namespace Microsoft.AspNet.Mvc.ApplicationModels [DebuggerDisplay("ParameterModel: Name={ParameterName}")] public class ParameterModel { - public ParameterModel([NotNull] ParameterInfo parameterInfo, - [NotNull] IReadOnlyList attributes) + public ParameterModel( + [NotNull] ParameterInfo parameterInfo, + [NotNull] IReadOnlyList attributes) { ParameterInfo = parameterInfo; diff --git a/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/PropertyModel.cs b/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/PropertyModel.cs index 7fbfe2056c..20e9b78f50 100644 --- a/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/PropertyModel.cs +++ b/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/PropertyModel.cs @@ -20,8 +20,9 @@ namespace Microsoft.AspNet.Mvc.ApplicationModels /// /// The for the underlying property. /// Any attributes which are annotated on the property. - public PropertyModel([NotNull] PropertyInfo propertyInfo, - [NotNull] IReadOnlyList attributes) + public PropertyModel( + [NotNull] PropertyInfo propertyInfo, + [NotNull] IReadOnlyList attributes) { PropertyInfo = propertyInfo; diff --git a/src/Microsoft.AspNet.Mvc.Core/CreatedAtActionResult.cs b/src/Microsoft.AspNet.Mvc.Core/CreatedAtActionResult.cs index 4ebf8d69e3..447f0b2ac8 100644 --- a/src/Microsoft.AspNet.Mvc.Core/CreatedAtActionResult.cs +++ b/src/Microsoft.AspNet.Mvc.Core/CreatedAtActionResult.cs @@ -25,10 +25,11 @@ namespace Microsoft.AspNet.Mvc /// The name of the controller to use for generating the URL. /// The route data to use for generating the URL. /// The value to format in the entity body. - public CreatedAtActionResult(string actionName, - string controllerName, - object routeValues, - object value) + public CreatedAtActionResult( + string actionName, + string controllerName, + object routeValues, + object value) : base(value) { ActionName = actionName; diff --git a/src/Microsoft.AspNet.Mvc.Core/CreatedAtRouteResult.cs b/src/Microsoft.AspNet.Mvc.Core/CreatedAtRouteResult.cs index 5a8c422c18..adb60fd56c 100644 --- a/src/Microsoft.AspNet.Mvc.Core/CreatedAtRouteResult.cs +++ b/src/Microsoft.AspNet.Mvc.Core/CreatedAtRouteResult.cs @@ -36,9 +36,10 @@ namespace Microsoft.AspNet.Mvc /// The name of the route to use for generating the URL. /// The route data to use for generating the URL. /// The value to format in the entity body. - public CreatedAtRouteResult(string routeName, - object routeValues, - object value) + public CreatedAtRouteResult( + string routeName, + object routeValues, + object value) : base(value) { RouteName = routeName; diff --git a/src/Microsoft.AspNet.Mvc.Core/Internal/NonDisposableStream.cs b/src/Microsoft.AspNet.Mvc.Core/Internal/NonDisposableStream.cs index 7087dbe4b9..f06d60584a 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Internal/NonDisposableStream.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Internal/NonDisposableStream.cs @@ -107,8 +107,12 @@ namespace Microsoft.AspNet.Mvc.Internal } #if DNX451 /// - public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, - AsyncCallback callback, object state) + public override IAsyncResult BeginRead( + byte[] buffer, + int offset, + int count, + AsyncCallback callback, + object state) { return _innerStream.BeginRead(buffer, offset, count, callback, state); } @@ -162,8 +166,12 @@ namespace Microsoft.AspNet.Mvc.Internal } #if DNX451 /// - public override IAsyncResult BeginWrite(byte[] buffer, int offset, int count, - AsyncCallback callback, object state) + public override IAsyncResult BeginWrite( + byte[] buffer, + int offset, + int count, + AsyncCallback callback, + object state) { return _innerStream.BeginWrite(buffer, offset, count, callback, state); } diff --git a/src/Microsoft.AspNet.Mvc.Core/ModelBindingHelper.cs b/src/Microsoft.AspNet.Mvc.Core/ModelBindingHelper.cs index 321588a5ae..3bb5dee544 100644 --- a/src/Microsoft.AspNet.Mvc.Core/ModelBindingHelper.cs +++ b/src/Microsoft.AspNet.Mvc.Core/ModelBindingHelper.cs @@ -457,9 +457,10 @@ namespace Microsoft.AspNet.Mvc } } - internal static void ValidateBindingContext(ModelBindingContext bindingContext, - Type requiredType, - bool allowNullModel) + internal static void ValidateBindingContext( + ModelBindingContext bindingContext, + Type requiredType, + bool allowNullModel) { ValidateBindingContext(bindingContext); diff --git a/src/Microsoft.AspNet.Mvc.Core/Routing/KnownRouteValueConstraint.cs b/src/Microsoft.AspNet.Mvc.Core/Routing/KnownRouteValueConstraint.cs index 988ad45362..d48a1f2817 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Routing/KnownRouteValueConstraint.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Routing/KnownRouteValueConstraint.cs @@ -17,11 +17,12 @@ namespace Microsoft.AspNet.Mvc.Routing { private RouteValuesCollection _cachedValuesCollection; - public bool Match([NotNull] HttpContext httpContext, - [NotNull] IRouter route, - [NotNull] string routeKey, - [NotNull] IDictionary values, - RouteDirection routeDirection) + public bool Match( + [NotNull] HttpContext httpContext, + [NotNull] IRouter route, + [NotNull] string routeKey, + [NotNull] IDictionary values, + RouteDirection routeDirection) { object value; if (values.TryGetValue(routeKey, out value)) diff --git a/src/Microsoft.AspNet.Mvc.DataAnnotations/DataTypeAttributeAdapter.cs b/src/Microsoft.AspNet.Mvc.DataAnnotations/DataTypeAttributeAdapter.cs index 72309d7dda..3967012cfc 100644 --- a/src/Microsoft.AspNet.Mvc.DataAnnotations/DataTypeAttributeAdapter.cs +++ b/src/Microsoft.AspNet.Mvc.DataAnnotations/DataTypeAttributeAdapter.cs @@ -15,8 +15,9 @@ namespace Microsoft.AspNet.Mvc.ModelBinding.Validation /// public class DataTypeAttributeAdapter : DataAnnotationsClientModelValidator { - public DataTypeAttributeAdapter(DataTypeAttribute attribute, - [NotNull] string ruleName) + public DataTypeAttributeAdapter( + DataTypeAttribute attribute, + [NotNull] string ruleName) : base(attribute) { if (string.IsNullOrEmpty(ruleName)) diff --git a/src/Microsoft.AspNet.Mvc.DataAnnotations/ModelClientValidationEqualToRule.cs b/src/Microsoft.AspNet.Mvc.DataAnnotations/ModelClientValidationEqualToRule.cs index 265aacba0a..c3f11d7671 100644 --- a/src/Microsoft.AspNet.Mvc.DataAnnotations/ModelClientValidationEqualToRule.cs +++ b/src/Microsoft.AspNet.Mvc.DataAnnotations/ModelClientValidationEqualToRule.cs @@ -13,8 +13,9 @@ namespace Microsoft.AspNet.Mvc.ModelBinding.Validation private const string EqualToValidationType = "equalto"; private const string EqualToValidationParameter = "other"; - public ModelClientValidationEqualToRule([NotNull] string errorMessage, - [NotNull] object other) + public ModelClientValidationEqualToRule( + [NotNull] string errorMessage, + [NotNull] object other) : base(EqualToValidationType, errorMessage) { ValidationParameters[EqualToValidationParameter] = other; diff --git a/src/Microsoft.AspNet.Mvc.DataAnnotations/ModelClientValidationRangeRule.cs b/src/Microsoft.AspNet.Mvc.DataAnnotations/ModelClientValidationRangeRule.cs index cc659f2ccc..f8ecdc5a66 100644 --- a/src/Microsoft.AspNet.Mvc.DataAnnotations/ModelClientValidationRangeRule.cs +++ b/src/Microsoft.AspNet.Mvc.DataAnnotations/ModelClientValidationRangeRule.cs @@ -11,9 +11,10 @@ namespace Microsoft.AspNet.Mvc.ModelBinding.Validation private const string MinValidationParameter = "min"; private const string MaxValidationParameter = "max"; - public ModelClientValidationRangeRule([NotNull] string errorMessage, - [NotNull] object minValue, - [NotNull] object maxValue) + public ModelClientValidationRangeRule( + [NotNull] string errorMessage, + [NotNull] object minValue, + [NotNull] object maxValue) : base(RangeValidationType, errorMessage) { ValidationParameters[MinValidationParameter] = minValue; diff --git a/src/Microsoft.AspNet.Mvc.Formatters.Xml/XmlDataContractSerializerOutputFormatter.cs b/src/Microsoft.AspNet.Mvc.Formatters.Xml/XmlDataContractSerializerOutputFormatter.cs index dee73b0020..d486b74eed 100644 --- a/src/Microsoft.AspNet.Mvc.Formatters.Xml/XmlDataContractSerializerOutputFormatter.cs +++ b/src/Microsoft.AspNet.Mvc.Formatters.Xml/XmlDataContractSerializerOutputFormatter.cs @@ -156,8 +156,9 @@ namespace Microsoft.AspNet.Mvc.Formatters /// /// The stream on which the XmlWriter should operate on. /// A new instance of - public virtual XmlWriter CreateXmlWriter([NotNull] Stream writeStream, - [NotNull] XmlWriterSettings xmlWriterSettings) + public virtual XmlWriter CreateXmlWriter( + [NotNull] Stream writeStream, + [NotNull] XmlWriterSettings xmlWriterSettings) { return XmlWriter.Create( new HttpResponseStreamWriter(writeStream, xmlWriterSettings.Encoding), diff --git a/src/Microsoft.AspNet.Mvc.Formatters.Xml/XmlSerializerOutputFormatter.cs b/src/Microsoft.AspNet.Mvc.Formatters.Xml/XmlSerializerOutputFormatter.cs index e9369aeb3c..b200260ae7 100644 --- a/src/Microsoft.AspNet.Mvc.Formatters.Xml/XmlSerializerOutputFormatter.cs +++ b/src/Microsoft.AspNet.Mvc.Formatters.Xml/XmlSerializerOutputFormatter.cs @@ -131,8 +131,9 @@ namespace Microsoft.AspNet.Mvc.Formatters /// /// The stream on which the XmlWriter should operate on. /// A new instance of - public virtual XmlWriter CreateXmlWriter([NotNull] Stream writeStream, - [NotNull] XmlWriterSettings xmlWriterSettings) + public virtual XmlWriter CreateXmlWriter( + [NotNull] Stream writeStream, + [NotNull] XmlWriterSettings xmlWriterSettings) { return XmlWriter.Create( new HttpResponseStreamWriter(writeStream, xmlWriterSettings.Encoding), diff --git a/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/DefaultChunkTreeCache.cs b/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/DefaultChunkTreeCache.cs index f6ccecc94a..2f6cae5471 100644 --- a/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/DefaultChunkTreeCache.cs +++ b/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/DefaultChunkTreeCache.cs @@ -31,8 +31,9 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives } // Internal for unit testing - internal DefaultChunkTreeCache(IFileProvider fileProvider, - MemoryCacheOptions options) + internal DefaultChunkTreeCache( + IFileProvider fileProvider, + MemoryCacheOptions options) { _fileProvider = fileProvider; _chunkTreeCache = new MemoryCache(options); diff --git a/src/Microsoft.AspNet.Mvc.Razor.Host/InjectChunkVisitor.cs b/src/Microsoft.AspNet.Mvc.Razor.Host/InjectChunkVisitor.cs index 501c81b55f..bbd37b5672 100644 --- a/src/Microsoft.AspNet.Mvc.Razor.Host/InjectChunkVisitor.cs +++ b/src/Microsoft.AspNet.Mvc.Razor.Host/InjectChunkVisitor.cs @@ -12,9 +12,10 @@ namespace Microsoft.AspNet.Mvc.Razor { private readonly string _injectAttribute; - public InjectChunkVisitor(CSharpCodeWriter writer, - CodeGeneratorContext context, - string injectAttributeName) + public InjectChunkVisitor( + CSharpCodeWriter writer, + CodeGeneratorContext context, + string injectAttributeName) : base(writer, context) { if (writer == null) diff --git a/src/Microsoft.AspNet.Mvc.Razor.Host/MvcCSharpChunkVisitor.cs b/src/Microsoft.AspNet.Mvc.Razor.Host/MvcCSharpChunkVisitor.cs index d1401ac016..18d7dc7cc0 100644 --- a/src/Microsoft.AspNet.Mvc.Razor.Host/MvcCSharpChunkVisitor.cs +++ b/src/Microsoft.AspNet.Mvc.Razor.Host/MvcCSharpChunkVisitor.cs @@ -10,8 +10,9 @@ namespace Microsoft.AspNet.Mvc.Razor { public abstract class MvcCSharpChunkVisitor : CodeVisitor { - public MvcCSharpChunkVisitor(CSharpCodeWriter writer, - CodeGeneratorContext context) + public MvcCSharpChunkVisitor( + CSharpCodeWriter writer, + CodeGeneratorContext context) : base(writer, context) { if (writer == null) diff --git a/src/Microsoft.AspNet.Mvc.Razor/Compilation/CompilerCache.cs b/src/Microsoft.AspNet.Mvc.Razor/Compilation/CompilerCache.cs index 09f4d9db93..fc2c57bbc2 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/Compilation/CompilerCache.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/Compilation/CompilerCache.cs @@ -49,11 +49,6 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation IDictionary precompiledViews) : this(fileProvider) { - if (fileProvider == null) - { - throw new ArgumentNullException(nameof(fileProvider)); - } - if (precompiledViews == null) { throw new ArgumentNullException(nameof(precompiledViews)); diff --git a/src/Microsoft.AspNet.Mvc.Razor/Precompilation/RazorPreCompiler.cs b/src/Microsoft.AspNet.Mvc.Razor/Precompilation/RazorPreCompiler.cs index c03b76240c..fa96f23e7b 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/Precompilation/RazorPreCompiler.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/Precompilation/RazorPreCompiler.cs @@ -331,9 +331,10 @@ namespace Microsoft.AspNet.Mvc.Razor.Precompilation private class PrecompileRazorFileInfoCollection : RazorFileInfoCollection { - public PrecompileRazorFileInfoCollection(string assemblyResourceName, - string symbolsResourceName, - IReadOnlyList fileInfos) + public PrecompileRazorFileInfoCollection( + string assemblyResourceName, + string symbolsResourceName, + IReadOnlyList fileInfos) { AssemblyResourceName = assemblyResourceName; SymbolsResourceName = symbolsResourceName; diff --git a/src/Microsoft.AspNet.Mvc.Razor/RazorView.cs b/src/Microsoft.AspNet.Mvc.Razor/RazorView.cs index 976ddce3a8..f9fdf55246 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/RazorView.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/RazorView.cs @@ -38,11 +38,11 @@ namespace Microsoft.AspNet.Mvc.Razor /// pages public RazorView( IRazorViewEngine viewEngine, - IRazorPageActivator pageActivator, - IViewStartProvider viewStartProvider, - IRazorPage razorPage, - IHtmlEncoder htmlEncoder, - bool isPartial) + IRazorPageActivator pageActivator, + IViewStartProvider viewStartProvider, + IRazorPage razorPage, + IHtmlEncoder htmlEncoder, + bool isPartial) { _viewEngine = viewEngine; _pageActivator = pageActivator; @@ -81,11 +81,6 @@ namespace Microsoft.AspNet.Mvc.Razor throw new ArgumentNullException(nameof(context)); } - if (context == null) - { - throw new ArgumentNullException(nameof(context)); - } - _pageExecutionFeature = context.HttpContext.Features.Get(); // Partials don't execute _ViewStart pages, but may execute Layout pages if the Layout property diff --git a/src/Microsoft.AspNet.Mvc.Razor/RazorViewEngineOptionsSetup.cs b/src/Microsoft.AspNet.Mvc.Razor/RazorViewEngineOptionsSetup.cs index f72c3d9c9a..3df62bca20 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/RazorViewEngineOptionsSetup.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/RazorViewEngineOptionsSetup.cs @@ -22,8 +22,9 @@ namespace Microsoft.AspNet.Mvc { } - private static void ConfigureRazor(RazorViewEngineOptions razorOptions, - IApplicationEnvironment applicationEnvironment) + private static void ConfigureRazor( + RazorViewEngineOptions razorOptions, + IApplicationEnvironment applicationEnvironment) { razorOptions.FileProvider = new PhysicalFileProvider(applicationEnvironment.ApplicationBasePath); } diff --git a/src/Microsoft.AspNet.Mvc.Razor/ViewLocationCacheResult.cs b/src/Microsoft.AspNet.Mvc.Razor/ViewLocationCacheResult.cs index 6188d21ee6..0e05ab37ae 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/ViewLocationCacheResult.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/ViewLocationCacheResult.cs @@ -30,11 +30,6 @@ namespace Microsoft.AspNet.Mvc.Razor throw new ArgumentNullException(nameof(foundLocation)); } - if (searchedLocations == null) - { - throw new ArgumentNullException(nameof(searchedLocations)); - } - ViewLocation = foundLocation; SearchedLocations = searchedLocations; IsFoundResult = true; diff --git a/src/Microsoft.AspNet.Mvc.Razor/ViewLocationExpanderContext.cs b/src/Microsoft.AspNet.Mvc.Razor/ViewLocationExpanderContext.cs index 1e775dcda4..35c4f6bc04 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/ViewLocationExpanderContext.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/ViewLocationExpanderContext.cs @@ -17,9 +17,10 @@ namespace Microsoft.AspNet.Mvc.Razor /// The for the current executing action. /// The view name. /// Determines if the view being discovered is a partial. - public ViewLocationExpanderContext(ActionContext actionContext, - string viewName, - bool isPartial) + public ViewLocationExpanderContext( + ActionContext actionContext, + string viewName, + bool isPartial) { if (actionContext == null) { diff --git a/src/Microsoft.AspNet.Mvc.TagHelpers/CacheTagHelper.cs b/src/Microsoft.AspNet.Mvc.TagHelpers/CacheTagHelper.cs index b19cef1d13..d4682845e1 100644 --- a/src/Microsoft.AspNet.Mvc.TagHelpers/CacheTagHelper.cs +++ b/src/Microsoft.AspNet.Mvc.TagHelpers/CacheTagHelper.cs @@ -237,10 +237,11 @@ namespace Microsoft.AspNet.Mvc.TagHelpers return options; } - private static void AddStringCollectionKey(StringBuilder builder, - string keyName, - string value, - IReadableStringCollection sourceCollection) + private static void AddStringCollectionKey( + StringBuilder builder, + string keyName, + string value, + IReadableStringCollection sourceCollection) { if (!string.IsNullOrEmpty(value)) { diff --git a/src/Microsoft.AspNet.Mvc.ViewFeatures/Controller.cs b/src/Microsoft.AspNet.Mvc.ViewFeatures/Controller.cs index 3fce0d0ecc..3066cfea15 100644 --- a/src/Microsoft.AspNet.Mvc.ViewFeatures/Controller.cs +++ b/src/Microsoft.AspNet.Mvc.ViewFeatures/Controller.cs @@ -570,8 +570,10 @@ namespace Microsoft.AspNet.Mvc /// The parameters for a route. /// The created for the response. [NonAction] - public virtual RedirectToActionResult RedirectToAction(string actionName, string controllerName, - object routeValues) + public virtual RedirectToActionResult RedirectToAction( + string actionName, + string controllerName, + object routeValues) { return new RedirectToActionResult(actionName, controllerName, PropertyHelper.ObjectToDictionary(routeValues)) { @@ -627,8 +629,10 @@ namespace Microsoft.AspNet.Mvc /// The parameters for a route. /// The created for the response. [NonAction] - public virtual RedirectToActionResult RedirectToActionPermanent(string actionName, string controllerName, - object routeValues) + public virtual RedirectToActionResult RedirectToActionPermanent( + string actionName, + string controllerName, + object routeValues) { return new RedirectToActionResult( actionName, @@ -984,10 +988,11 @@ namespace Microsoft.AspNet.Mvc /// The content value to format in the entity body. /// The created for the response. [NonAction] - public virtual CreatedAtActionResult CreatedAtAction(string actionName, - string controllerName, - object routeValues, - object value) + public virtual CreatedAtActionResult CreatedAtAction( + string actionName, + string controllerName, + object routeValues, + object value) { var disposableValue = value as IDisposable; if (disposableValue != null) @@ -1419,7 +1424,7 @@ namespace Microsoft.AspNet.Mvc /// true if the is valid;false otherwise. [NonAction] public virtual bool TryValidateModel( - [NotNull] object model, + [NotNull] object model, string prefix) { if (BindingContext == null) diff --git a/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewEngines/CompositeViewEngine.cs b/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewEngines/CompositeViewEngine.cs index 0b97ba801c..115ec3307d 100644 --- a/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewEngines/CompositeViewEngine.cs +++ b/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewEngines/CompositeViewEngine.cs @@ -24,22 +24,25 @@ namespace Microsoft.AspNet.Mvc.ViewEngines public IReadOnlyList ViewEngines { get; } /// - public ViewEngineResult FindPartialView([NotNull] ActionContext context, - [NotNull] string partialViewName) + public ViewEngineResult FindPartialView( + [NotNull] ActionContext context, + [NotNull] string partialViewName) { return FindView(context, partialViewName, partial: true); } /// - public ViewEngineResult FindView([NotNull] ActionContext context, - [NotNull] string viewName) + public ViewEngineResult FindView( + [NotNull] ActionContext context, + [NotNull] string viewName) { return FindView(context, viewName, partial: false); } - private ViewEngineResult FindView(ActionContext context, - string viewName, - bool partial) + private ViewEngineResult FindView( + ActionContext context, + string viewName, + bool partial) { var searchedLocations = Enumerable.Empty(); foreach (var engine in ViewEngines) diff --git a/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewEngines/ViewEngineResult.cs b/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewEngines/ViewEngineResult.cs index 14d11ead56..9ac25fc67a 100644 --- a/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewEngines/ViewEngineResult.cs +++ b/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewEngines/ViewEngineResult.cs @@ -25,8 +25,9 @@ namespace Microsoft.AspNet.Mvc.ViewEngines get { return View != null; } } - public static ViewEngineResult NotFound([NotNull] string viewName, - [NotNull] IEnumerable searchedLocations) + public static ViewEngineResult NotFound( + [NotNull] string viewName, + [NotNull] IEnumerable searchedLocations) { return new ViewEngineResult { diff --git a/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewFeatures/HtmlHelper.cs b/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewFeatures/HtmlHelper.cs index 619fc5b5d7..19b748fd49 100644 --- a/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewFeatures/HtmlHelper.cs +++ b/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewFeatures/HtmlHelper.cs @@ -283,10 +283,11 @@ namespace Microsoft.AspNet.Mvc.ViewFeatures } /// - public IHtmlContent Display(string expression, - string templateName, - string htmlFieldName, - object additionalViewData) + public IHtmlContent Display( + string expression, + string templateName, + string htmlFieldName, + object additionalViewData) { var metadata = ExpressionMetadataProvider.FromStringExpression(expression, ViewData, MetadataProvider); diff --git a/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewFeatures/TemplateBuilder.cs b/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewFeatures/TemplateBuilder.cs index c6ff559009..fc1b968618 100644 --- a/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewFeatures/TemplateBuilder.cs +++ b/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewFeatures/TemplateBuilder.cs @@ -23,14 +23,15 @@ namespace Microsoft.AspNet.Mvc.ViewFeatures.Internal private bool _readOnly; private object _additionalViewData; - public TemplateBuilder([NotNull] IViewEngine viewEngine, - [NotNull] ViewContext viewContext, - [NotNull] ViewDataDictionary viewData, - [NotNull] ModelExplorer modelExplorer, - string htmlFieldName, - string templateName, - bool readOnly, - object additionalViewData) + public TemplateBuilder( + [NotNull] IViewEngine viewEngine, + [NotNull] ViewContext viewContext, + [NotNull] ViewDataDictionary viewData, + [NotNull] ModelExplorer modelExplorer, + string htmlFieldName, + string templateName, + bool readOnly, + object additionalViewData) { _viewEngine = viewEngine; _viewContext = viewContext; diff --git a/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewFeatures/UnobtrusiveValidationAttributesGenerator.cs b/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewFeatures/UnobtrusiveValidationAttributesGenerator.cs index 304ba5fcdc..7f92fd3d41 100644 --- a/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewFeatures/UnobtrusiveValidationAttributesGenerator.cs +++ b/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewFeatures/UnobtrusiveValidationAttributesGenerator.cs @@ -45,8 +45,10 @@ namespace Microsoft.AspNet.Mvc.ViewFeatures return results; } - private static void ValidateUnobtrusiveValidationRule(ModelClientValidationRule rule, - IDictionary resultsDictionary, string dictionaryKey) + private static void ValidateUnobtrusiveValidationRule( + ModelClientValidationRule rule, + IDictionary resultsDictionary, + string dictionaryKey) { if (string.IsNullOrEmpty(rule.ValidationType)) { diff --git a/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewFeatures/ViewDataDictionary.cs b/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewFeatures/ViewDataDictionary.cs index d21d3d486a..49df772bf1 100644 --- a/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewFeatures/ViewDataDictionary.cs +++ b/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewFeatures/ViewDataDictionary.cs @@ -28,8 +28,9 @@ namespace Microsoft.AspNet.Mvc.ViewFeatures /// /// instance for this scope. /// For use when creating a for a new top-level scope. - public ViewDataDictionary([NotNull] IModelMetadataProvider metadataProvider, - [NotNull] ModelStateDictionary modelState) + public ViewDataDictionary( + [NotNull] IModelMetadataProvider metadataProvider, + [NotNull] ModelStateDictionary modelState) : this(metadataProvider, modelState, declaredModelType: typeof(object)) { } diff --git a/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewFeatures/ViewExecutor.cs b/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewFeatures/ViewExecutor.cs index 329df9f9b0..4dda1eec05 100644 --- a/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewFeatures/ViewExecutor.cs +++ b/src/Microsoft.AspNet.Mvc.ViewFeatures/ViewFeatures/ViewExecutor.cs @@ -28,12 +28,13 @@ namespace Microsoft.AspNet.Mvc.ViewFeatures /// The for the view being rendered. /// The for the view being rendered. /// A that represents the asynchronous rendering. - public static async Task ExecuteAsync([NotNull] IView view, - [NotNull] ActionContext actionContext, - [NotNull] ViewDataDictionary viewData, - [NotNull] ITempDataDictionary tempData, - [NotNull] HtmlHelperOptions htmlHelperOptions, - MediaTypeHeaderValue contentType) + public static async Task ExecuteAsync( + [NotNull] IView view, + [NotNull] ActionContext actionContext, + [NotNull] ViewDataDictionary viewData, + [NotNull] ITempDataDictionary tempData, + [NotNull] HtmlHelperOptions htmlHelperOptions, + MediaTypeHeaderValue contentType) { var response = actionContext.HttpContext.Response; diff --git a/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/StringWithQualityHeaderValueComparer.cs b/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/StringWithQualityHeaderValueComparer.cs index 874d1696f0..fa2b549ecc 100644 --- a/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/StringWithQualityHeaderValueComparer.cs +++ b/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/StringWithQualityHeaderValueComparer.cs @@ -40,8 +40,9 @@ namespace System.Net.Http.Formatting /// The first value to compare. /// The second value to compare /// The result of the comparison. - public int Compare(StringWithQualityHeaderValue stringWithQuality1, - StringWithQualityHeaderValue stringWithQuality2) + public int Compare( + StringWithQualityHeaderValue stringWithQuality1, + StringWithQualityHeaderValue stringWithQuality2) { Debug.Assert(stringWithQuality1 != null); Debug.Assert(stringWithQuality2 != null); diff --git a/test/Microsoft.AspNet.Mvc.Core.Test/Formatters/NoContentFormatterTests.cs b/test/Microsoft.AspNet.Mvc.Core.Test/Formatters/NoContentFormatterTests.cs index d593da3c52..f4146eeac7 100644 --- a/test/Microsoft.AspNet.Mvc.Core.Test/Formatters/NoContentFormatterTests.cs +++ b/test/Microsoft.AspNet.Mvc.Core.Test/Formatters/NoContentFormatterTests.cs @@ -33,10 +33,11 @@ namespace Microsoft.AspNet.Mvc.Formatters [Theory] [MemberData(nameof(OutputFormatterContextValues_CanWriteType))] - public void CanWriteResult_ByDefault_ReturnsTrue_IfTheValueIsNull(object value, - bool declaredTypeAsString, - bool expectedCanwriteResult, - bool useNonNullContentType) + public void CanWriteResult_ByDefault_ReturnsTrue_IfTheValueIsNull( + object value, + bool declaredTypeAsString, + bool expectedCanwriteResult, + bool useNonNullContentType) { // Arrange var typeToUse = declaredTypeAsString ? typeof(string) : typeof(object); diff --git a/test/Microsoft.AspNet.Mvc.Core.Test/Formatters/OutputFormatterTests.cs b/test/Microsoft.AspNet.Mvc.Core.Test/Formatters/OutputFormatterTests.cs index 7b81d8eafb..7d89def02d 100644 --- a/test/Microsoft.AspNet.Mvc.Core.Test/Formatters/OutputFormatterTests.cs +++ b/test/Microsoft.AspNet.Mvc.Core.Test/Formatters/OutputFormatterTests.cs @@ -42,10 +42,11 @@ namespace Microsoft.AspNet.Mvc.Formatters [Theory] [MemberData(nameof(SelectResponseCharacterEncodingData))] - public void SelectResponseCharacterEncoding_SelectsEncoding(string acceptCharsetHeaders, - string requestEncoding, - string[] supportedEncodings, - string expectedEncoding) + public void SelectResponseCharacterEncoding_SelectsEncoding( + string acceptCharsetHeaders, + string requestEncoding, + string[] supportedEncodings, + string expectedEncoding) { // Arrange var mockHttpContext = new Mock(); diff --git a/test/Microsoft.AspNet.Mvc.Core.Test/RedirectResultTest.cs b/test/Microsoft.AspNet.Mvc.Core.Test/RedirectResultTest.cs index 47615477d5..9f0c3f11d7 100644 --- a/test/Microsoft.AspNet.Mvc.Core.Test/RedirectResultTest.cs +++ b/test/Microsoft.AspNet.Mvc.Core.Test/RedirectResultTest.cs @@ -45,9 +45,10 @@ namespace Microsoft.AspNet.Mvc [Theory] [InlineData("", "/Home/About", "/Home/About")] [InlineData("/myapproot", "/test", "/test")] - public void Execute_ReturnsContentPath_WhenItDoesNotStartWithTilde(string appRoot, - string contentPath, - string expectedPath) + public void Execute_ReturnsContentPath_WhenItDoesNotStartWithTilde( + string appRoot, + string contentPath, + string expectedPath) { // Arrange var httpResponse = new Mock(); @@ -72,9 +73,10 @@ namespace Microsoft.AspNet.Mvc [InlineData("/", "~/", "/")] [InlineData("", "~/Home/About", "/Home/About")] [InlineData("/myapproot", "~/", "/myapproot/")] - public void Execute_ReturnsAppRelativePath_WhenItStartsWithTilde(string appRoot, - string contentPath, - string expectedPath) + public void Execute_ReturnsAppRelativePath_WhenItStartsWithTilde( + string appRoot, + string contentPath, + string expectedPath) { // Arrange var httpResponse = new Mock(); @@ -110,10 +112,11 @@ namespace Microsoft.AspNet.Mvc return serviceCollection.BuildServiceProvider(); } - private static HttpContext GetHttpContext(string appRoot, - string contentPath, - string expectedPath, - HttpResponse response) + private static HttpContext GetHttpContext( + string appRoot, + string contentPath, + string expectedPath, + HttpResponse response) { var httpContext = new Mock(); var actionContext = GetActionContext(httpContext.Object); diff --git a/test/Microsoft.AspNet.Mvc.Core.Test/Routing/UrlHelperTest.cs b/test/Microsoft.AspNet.Mvc.Core.Test/Routing/UrlHelperTest.cs index 3a38faae30..5f5097e9ba 100644 --- a/test/Microsoft.AspNet.Mvc.Core.Test/Routing/UrlHelperTest.cs +++ b/test/Microsoft.AspNet.Mvc.Core.Test/Routing/UrlHelperTest.cs @@ -25,9 +25,10 @@ namespace Microsoft.AspNet.Mvc.Routing [InlineData("/myapproot", null, null)] [InlineData("", "/Home/About", "/Home/About")] [InlineData("/myapproot", "/test", "/test")] - public void Content_ReturnsContentPath_WhenItDoesNotStartWithToken(string appRoot, - string contentPath, - string expectedPath) + public void Content_ReturnsContentPath_WhenItDoesNotStartWithToken( + string appRoot, + string contentPath, + string expectedPath) { // Arrange var context = CreateHttpContext(GetServices(), appRoot); @@ -49,9 +50,10 @@ namespace Microsoft.AspNet.Mvc.Routing [InlineData("", "~/Home/About", "/Home/About")] [InlineData("/", "~", "/")] [InlineData("/myapproot", "~/Content/bootstrap.css", "/myapproot/Content/bootstrap.css")] - public void Content_ReturnsAppRelativePath_WhenItStartsWithToken(string appRoot, - string contentPath, - string expectedPath) + public void Content_ReturnsAppRelativePath_WhenItStartsWithToken( + string appRoot, + string contentPath, + string expectedPath) { // Arrange var context = CreateHttpContext(GetServices(), appRoot); diff --git a/test/Microsoft.AspNet.Mvc.Formatters.Xml.Test/XmlDataContractSerializerOutputFormatterTest.cs b/test/Microsoft.AspNet.Mvc.Formatters.Xml.Test/XmlDataContractSerializerOutputFormatterTest.cs index d552972066..dd8294fb33 100644 --- a/test/Microsoft.AspNet.Mvc.Formatters.Xml.Test/XmlDataContractSerializerOutputFormatterTest.cs +++ b/test/Microsoft.AspNet.Mvc.Formatters.Xml.Test/XmlDataContractSerializerOutputFormatterTest.cs @@ -598,7 +598,9 @@ namespace Microsoft.AspNet.Mvc.Formatters.Xml 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") { return new OutputFormatterContext diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcCSharpRazorCodeParserTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcCSharpRazorCodeParserTest.cs index b396a55b9f..f0f6c0666e 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcCSharpRazorCodeParserTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcCSharpRazorCodeParserTest.cs @@ -64,8 +64,9 @@ namespace Microsoft.AspNet.Mvc.Razor [InlineData("Foo?", "Foo?")] [InlineData("Foo[[]][]", "Foo[[]][]")] [InlineData("$rootnamespace$.MyModel", "$rootnamespace$.MyModel")] - public void ParseModelKeyword_InfersBaseType_FromModelName(string modelName, - string expectedModel) + public void ParseModelKeyword_InfersBaseType_FromModelName( + string modelName, + string expectedModel) { // Arrange var documentContent = "@model " + modelName + Environment.NewLine + "Bar"; @@ -270,9 +271,10 @@ namespace Microsoft.AspNet.Mvc.Razor [InlineData(" Microsoft.AspNet.Mvc.IHtmlHelper MyHelper ", "Microsoft.AspNet.Mvc.IHtmlHelper", "MyHelper")] [InlineData(" TestService @class ", "TestService", "@class")] - public void ParseInjectKeyword_InfersTypeAndPropertyName(string injectStatement, - string expectedService, - string expectedPropertyName) + public void ParseInjectKeyword_InfersTypeAndPropertyName( + string injectStatement, + string expectedService, + string expectedPropertyName) { // Arrange var documentContent = "@inject " + injectStatement; @@ -348,9 +350,10 @@ namespace Microsoft.AspNet.Mvc.Razor [Theory] [InlineData("IMyService Service ", "IMyService", "Service")] [InlineData(" TestService @namespace ", "TestService", "@namespace")] - public void ParseInjectKeyword_ParsesUpToNewLine(string injectStatement, - string expectedService, - string expectedPropertyName) + public void ParseInjectKeyword_ParsesUpToNewLine( + string injectStatement, + string expectedService, + string expectedPropertyName) { // Arrange var documentContent = "@inject " + injectStatement + Environment.NewLine + "Bar"; @@ -514,9 +517,10 @@ namespace Microsoft.AspNet.Mvc.Razor Assert.Equal(expectedErrors, errors); } - private static List ParseDocument(string documentContents, - List errors = null, - List lineMappings = null) + private static List ParseDocument( + string documentContents, + List errors = null, + List lineMappings = null) { errors = errors ?? new List(); var markupParser = new HtmlMarkupParser(); diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcRazorParserTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcRazorParserTest.cs index 6780aad5bd..df6845c59a 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcRazorParserTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcRazorParserTest.cs @@ -234,9 +234,10 @@ namespace Microsoft.AspNet.Mvc.Razor private class TestableMvcRazorParser : MvcRazorParser { - public TestableMvcRazorParser(RazorParser parser, - IReadOnlyList chunkTrees, - IReadOnlyList defaultInheritedChunks) + public TestableMvcRazorParser( + RazorParser parser, + IReadOnlyList chunkTrees, + IReadOnlyList defaultInheritedChunks) : base(parser, chunkTrees, defaultInheritedChunks, typeof(ModelExpression).FullName) { } diff --git a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcTagHelperAttributeValueCodeRendererTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcTagHelperAttributeValueCodeRendererTest.cs index 7b8c79c727..00008db847 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcTagHelperAttributeValueCodeRendererTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Host.Test/MvcTagHelperAttributeValueCodeRendererTest.cs @@ -14,9 +14,10 @@ namespace Microsoft.AspNet.Mvc.Razor [Theory] [InlineData("SomeType", "SomeType", "SomeMethod(__model => __model.MyValue)")] [InlineData("SomeType", "SomeType2", "MyValue")] - public void RenderAttributeValue_RendersModelExpressionsCorrectly(string modelExpressionType, - string propertyType, - string expectedValue) + public void RenderAttributeValue_RendersModelExpressionsCorrectly( + string modelExpressionType, + string propertyType, + string expectedValue) { // Arrange var renderer = new MvcTagHelperAttributeValueCodeRenderer( diff --git a/test/Microsoft.AspNet.Mvc.Razor.Test/RazorPageTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Test/RazorPageTest.cs index 5932347e00..95067e2f44 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Test/RazorPageTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Test/RazorPageTest.cs @@ -700,7 +700,7 @@ namespace Microsoft.AspNet.Mvc.Razor p.WriteAttribute("href", new PositionTagged("prefix", 0), new PositionTagged("suffix", 10), - new AttributeValue(new PositionTagged("", 6), + new AttributeValue(new PositionTagged(string.Empty, 6), new PositionTagged("true", 6), literal: false)); }); @@ -756,7 +756,7 @@ namespace Microsoft.AspNet.Mvc.Razor { new AttributeValue[] { new AttributeValue( - new PositionTagged("", 9), + new PositionTagged(string.Empty, 9), new PositionTagged("Hello", 9), literal: true) }, @@ -778,7 +778,7 @@ namespace Microsoft.AspNet.Mvc.Razor new PositionTagged(null, 10), literal: false) }, - "" + string.Empty }, { new AttributeValue[] { @@ -806,7 +806,7 @@ namespace Microsoft.AspNet.Mvc.Razor { new AttributeValue[] { new AttributeValue( - new PositionTagged("", 9), + new PositionTagged(string.Empty, 9), new PositionTagged("prefix", 9), literal: true), new AttributeValue( @@ -859,7 +859,7 @@ namespace Microsoft.AspNet.Mvc.Razor } [Theory] - [InlineData(null, "")] + [InlineData(null, string.Empty)] [InlineData(false, "False")] public void AddHtmlAttributeValues_OnlyAddsToAllAttributesWhenAttributeRemoved( object attributeValue, @@ -939,7 +939,7 @@ namespace Microsoft.AspNet.Mvc.Razor { new AttributeValue[] { new AttributeValue( - new PositionTagged("", 9), + new PositionTagged(string.Empty, 9), new PositionTagged(true, 9), literal: false) }, @@ -948,20 +948,20 @@ namespace Microsoft.AspNet.Mvc.Razor { new AttributeValue[] { new AttributeValue( - new PositionTagged("", 9), + new PositionTagged(string.Empty, 9), new PositionTagged(false, 9), literal: false) }, - "" + string.Empty }, { new AttributeValue[] { new AttributeValue( - new PositionTagged("", 9), + new PositionTagged(string.Empty, 9), new PositionTagged(null, 9), literal: false) }, - "" + string.Empty }, { new AttributeValue[] { @@ -1007,7 +1007,7 @@ namespace Microsoft.AspNet.Mvc.Razor page.HtmlEncoder = new CommonTestEncoder(); var writer = new StringWriter(); var prefix = new PositionTagged("someattr=", 0); - var suffix = new PositionTagged("", 0); + var suffix = new PositionTagged(string.Empty, 0); // Act page.WriteAttributeTo(writer, "someattr", prefix, suffix, attributeValues); @@ -1059,7 +1059,7 @@ namespace Microsoft.AspNet.Mvc.Razor }, { GetTagHelperOutput( - tagName: "", + tagName: string.Empty, attributes: new TagHelperAttributeList(), tagMode: TagMode.StartTagAndEndTag, preElement: null, @@ -1358,7 +1358,7 @@ namespace Microsoft.AspNet.Mvc.Razor }, { GetTagHelperOutput( - tagName: "", + tagName: string.Empty, attributes: new TagHelperAttributeList(), tagMode: TagMode.StartTagAndEndTag, preElement: "Before", @@ -1370,7 +1370,7 @@ namespace Microsoft.AspNet.Mvc.Razor }, { GetTagHelperOutput( - tagName: "", + tagName: string.Empty, attributes: new TagHelperAttributeList { { "test", "testVal" } }, tagMode: TagMode.SelfClosing, preElement: "Before", @@ -1406,7 +1406,7 @@ namespace Microsoft.AspNet.Mvc.Razor }, { GetTagHelperOutput( - tagName: "", + tagName: string.Empty, attributes: new TagHelperAttributeList { { "test", "testVal" } }, tagMode: TagMode.StartTagOnly, preElement: "Before", @@ -1454,7 +1454,7 @@ namespace Microsoft.AspNet.Mvc.Razor }, { GetTagHelperOutput( - tagName: "", + tagName: string.Empty, attributes: new TagHelperAttributeList(), tagMode: TagMode.StartTagAndEndTag, preElement: null, @@ -1466,7 +1466,7 @@ namespace Microsoft.AspNet.Mvc.Razor }, { GetTagHelperOutput( - tagName: "", + tagName: string.Empty, attributes: new TagHelperAttributeList { { "test", "testVal" } }, tagMode: TagMode.SelfClosing, preElement: null, @@ -1502,7 +1502,7 @@ namespace Microsoft.AspNet.Mvc.Razor }, { GetTagHelperOutput( - tagName: "", + tagName: string.Empty, attributes: new TagHelperAttributeList { { "test", "testVal" } }, tagMode: TagMode.StartTagOnly, preElement: null, @@ -1574,7 +1574,7 @@ namespace Microsoft.AspNet.Mvc.Razor }, { GetTagHelperOutput( - tagName: "", + tagName: string.Empty, attributes: new TagHelperAttributeList(), tagMode: TagMode.SelfClosing, preElement: "Before", @@ -1598,7 +1598,7 @@ namespace Microsoft.AspNet.Mvc.Razor }, { GetTagHelperOutput( - tagName: "", + tagName: string.Empty, attributes: new TagHelperAttributeList(), tagMode: TagMode.StartTagOnly, preElement: "Before", @@ -1610,7 +1610,7 @@ namespace Microsoft.AspNet.Mvc.Razor }, { GetTagHelperOutput( - tagName: "", + tagName: string.Empty, attributes: new TagHelperAttributeList(), tagMode: TagMode.StartTagAndEndTag, preElement: "Before", @@ -1622,7 +1622,7 @@ namespace Microsoft.AspNet.Mvc.Razor }, { GetTagHelperOutput( - tagName: "", + tagName: string.Empty, attributes: new TagHelperAttributeList { { "test", "testVal" } }, tagMode: TagMode.StartTagAndEndTag, preElement: "Before", diff --git a/test/Microsoft.AspNet.Mvc.Razor.Test/RazorViewEngineTest.cs b/test/Microsoft.AspNet.Mvc.Razor.Test/RazorViewEngineTest.cs index 0c1cdee844..d0cfc7ef61 100644 --- a/test/Microsoft.AspNet.Mvc.Razor.Test/RazorViewEngineTest.cs +++ b/test/Microsoft.AspNet.Mvc.Razor.Test/RazorViewEngineTest.cs @@ -338,8 +338,9 @@ namespace Microsoft.AspNet.Mvc.Razor.Test [Theory] [MemberData(nameof(ViewLocationExpanderTestData))] - public void FindView_UsesViewLocationExpandersToLocateViews(IDictionary routeValues, - IEnumerable expectedSeeds) + public void FindView_UsesViewLocationExpandersToLocateViews( + IDictionary routeValues, + IEnumerable expectedSeeds) { // Arrange var pageFactory = new Mock(); @@ -589,8 +590,9 @@ namespace Microsoft.AspNet.Mvc.Razor.Test [Theory] [MemberData(nameof(ViewLocationExpanderTestData))] - public void FindPage_UsesViewLocationExpander_ToExpandPaths(IDictionary routeValues, - IEnumerable expectedSeeds) + public void FindPage_UsesViewLocationExpander_ToExpandPaths( + IDictionary routeValues, + IEnumerable expectedSeeds) { // Arrange var page = Mock.Of(); @@ -1082,10 +1084,11 @@ namespace Microsoft.AspNet.Mvc.Razor.Test } } - private RazorViewEngine CreateViewEngine(IRazorPageFactory pageFactory = null, - IRazorViewFactory viewFactory = null, - IEnumerable expanders = null, - IViewLocationCache cache = null) + private RazorViewEngine CreateViewEngine( + IRazorPageFactory pageFactory = null, + IRazorViewFactory viewFactory = null, + IEnumerable expanders = null, + IViewLocationCache cache = null) { pageFactory = pageFactory ?? Mock.Of(); viewFactory = viewFactory ?? Mock.Of(); @@ -1176,10 +1179,11 @@ namespace Microsoft.AspNet.Mvc.Razor.Test private class OverloadedLocationViewEngine : RazorViewEngine { - public OverloadedLocationViewEngine(IRazorPageFactory pageFactory, - IRazorViewFactory viewFactory, - IOptions optionsAccessor, - IViewLocationCache cache) + public OverloadedLocationViewEngine( + IRazorPageFactory pageFactory, + IRazorViewFactory viewFactory, + IOptions optionsAccessor, + IViewLocationCache cache) : base(pageFactory, viewFactory, optionsAccessor, cache) { } diff --git a/test/Microsoft.AspNet.Mvc.TagHelpers.Test/CacheTagHelperTest.cs b/test/Microsoft.AspNet.Mvc.TagHelpers.Test/CacheTagHelperTest.cs index ab6b1a15fe..365b02eb90 100644 --- a/test/Microsoft.AspNet.Mvc.TagHelpers.Test/CacheTagHelperTest.cs +++ b/test/Microsoft.AspNet.Mvc.TagHelpers.Test/CacheTagHelperTest.cs @@ -777,8 +777,9 @@ namespace Microsoft.AspNet.Mvc.TagHelpers new HtmlHelperOptions()); } - private static TagHelperContext GetTagHelperContext(string id = "testid", - string childContent = "some child content") + private static TagHelperContext GetTagHelperContext( + string id = "testid", + string childContent = "some child content") { return new TagHelperContext( allAttributes: new TagHelperAttributeList(), diff --git a/test/Microsoft.AspNet.Mvc.TagHelpers.Test/LabelTagHelperTest.cs b/test/Microsoft.AspNet.Mvc.TagHelpers.Test/LabelTagHelperTest.cs index 61f03eae1b..2d9d586531 100644 --- a/test/Microsoft.AspNet.Mvc.TagHelpers.Test/LabelTagHelperTest.cs +++ b/test/Microsoft.AspNet.Mvc.TagHelpers.Test/LabelTagHelperTest.cs @@ -233,10 +233,11 @@ namespace Microsoft.AspNet.Mvc.TagHelpers public class TagHelperOutputContent { - public TagHelperOutputContent(string originalChildContent, - string outputContent, - string expectedContent, - string expectedId) + public TagHelperOutputContent( + string originalChildContent, + string outputContent, + string expectedContent, + string expectedId) { OriginalChildContent = originalChildContent; OriginalContent = outputContent; diff --git a/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/Rendering/HtmlHelperPasswordTest.cs b/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/Rendering/HtmlHelperPasswordTest.cs index c88893f2d3..eee37f862f 100644 --- a/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/Rendering/HtmlHelperPasswordTest.cs +++ b/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/Rendering/HtmlHelperPasswordTest.cs @@ -41,8 +41,9 @@ namespace Microsoft.AspNet.Mvc.Rendering [Theory] [MemberData(nameof(PasswordWithViewDataAndAttributesData))] - public void Password_UsesAttributeValueWhenValueArgumentIsNull(ViewDataDictionary vdd, - object attributes) + public void Password_UsesAttributeValueWhenValueArgumentIsNull( + ViewDataDictionary vdd, + object attributes) { // Arrange var expected = @" vdd, - object attributes) + public void Password_UsesExplicitValue_IfSpecified( + ViewDataDictionary vdd, + object attributes) { // Arrange var expected = @" vdd, - object htmlAttributes) + public void PasswordForWithAttributes_GeneratesExpectedValue( + ViewDataDictionary vdd, + object htmlAttributes) { // Arrange var expected = @" expectedEntry) + public void AnonymousObjectToHtmlAttributes_IgnoresPropertyCase( + object htmlAttributeObject, + KeyValuePair expectedEntry) { // Act var result = HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributeObject); diff --git a/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ViewFeatures/ViewDataDictionaryTest.cs b/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ViewFeatures/ViewDataDictionaryTest.cs index 286d080f9c..3a947f1b09 100644 --- a/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ViewFeatures/ViewDataDictionaryTest.cs +++ b/test/Microsoft.AspNet.Mvc.ViewFeatures.Test/ViewFeatures/ViewDataDictionaryTest.cs @@ -792,8 +792,9 @@ namespace Microsoft.AspNet.Mvc.ViewFeatures private class TestViewDataDictionary : ViewDataDictionary { - public TestViewDataDictionary(IModelMetadataProvider modelMetadataProvider, - ModelStateDictionary modelState) + public TestViewDataDictionary( + IModelMetadataProvider modelMetadataProvider, + ModelStateDictionary modelState) : base(modelMetadataProvider, modelState) { } diff --git a/test/Microsoft.AspNet.Mvc.WebApiCompatShimTest/TestUtils/TestDataSetAttribute.cs b/test/Microsoft.AspNet.Mvc.WebApiCompatShimTest/TestUtils/TestDataSetAttribute.cs index ed0f3487b4..33a5897181 100644 --- a/test/Microsoft.AspNet.Mvc.WebApiCompatShimTest/TestUtils/TestDataSetAttribute.cs +++ b/test/Microsoft.AspNet.Mvc.WebApiCompatShimTest/TestUtils/TestDataSetAttribute.cs @@ -28,38 +28,56 @@ namespace Microsoft.TestCommon ExtraDataSets = new List>(); } - public TestDataSetAttribute(Type declaringType, string propertyName, - Type declaringType1, string propertyName1, - TestDataVariations testDataVariations = TestCommon.TestDataVariations.All) + public TestDataSetAttribute( + Type declaringType, + string propertyName, + Type declaringType1, + string propertyName1, + TestDataVariations testDataVariations = TestCommon.TestDataVariations.All) : this(declaringType, propertyName, testDataVariations) { ExtraDataSets = new List> { Tuple.Create(declaringType1, propertyName1) }; } - public TestDataSetAttribute(Type declaringType, string propertyName, - Type declaringType1, string propertyName1, - Type declaringType2, string propertyName2, + public TestDataSetAttribute( + Type declaringType, + string propertyName, + Type declaringType1, + string propertyName1, + Type declaringType2, + string propertyName2, TestDataVariations testDataVariations = TestCommon.TestDataVariations.All) : this(declaringType, propertyName, testDataVariations) { ExtraDataSets = new List> { Tuple.Create(declaringType1, propertyName1), Tuple.Create(declaringType2, propertyName2) }; } - public TestDataSetAttribute(Type declaringType, string propertyName, - Type declaringType1, string propertyName1, - Type declaringType2, string propertyName2, - Type declaringType3, string propertyName3, + public TestDataSetAttribute( + Type declaringType, + string propertyName, + Type declaringType1, + string propertyName1, + Type declaringType2, + string propertyName2, + Type declaringType3, + string propertyName3, TestDataVariations testDataVariations = TestCommon.TestDataVariations.All) : this(declaringType, propertyName, testDataVariations) { ExtraDataSets = new List> { Tuple.Create(declaringType1, propertyName1), Tuple.Create(declaringType2, propertyName2), Tuple.Create(declaringType3, propertyName3) }; } - public TestDataSetAttribute(Type declaringType, string propertyName, - Type declaringType1, string propertyName1, - Type declaringType2, string propertyName2, - Type declaringType3, string propertyName3, - Type declaringType4, string propertyName4, + public TestDataSetAttribute( + Type declaringType, + string propertyName, + Type declaringType1, + string propertyName1, + Type declaringType2, + string propertyName2, + Type declaringType3, + string propertyName3, + Type declaringType4, + string propertyName4, TestDataVariations testDataVariations = TestCommon.TestDataVariations.All) : this(declaringType, propertyName, testDataVariations) {