From e0116bab3094ea248c313b182fc54d1f707dc585 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 27 Oct 2014 15:07:53 -0700 Subject: [PATCH] Modifying ArgumentNullOrEmpty message to be consistent with Mvc 5 \ testing code. --- .../Properties/Resources.Designer.cs | 4 ++-- src/Microsoft.AspNet.Mvc.ModelBinding/Resources.resx | 2 +- .../Properties/Resources.Designer.cs | 4 ++-- src/Microsoft.AspNet.Mvc.Razor.Host/Resources.resx | 2 +- .../Properties/Resources.Designer.cs | 4 ++-- src/Microsoft.AspNet.Mvc.Razor/Resources.resx | 2 +- .../Metadata/AssociatedMetadataProviderTest.cs | 10 ++++------ 7 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/Microsoft.AspNet.Mvc.ModelBinding/Properties/Resources.Designer.cs b/src/Microsoft.AspNet.Mvc.ModelBinding/Properties/Resources.Designer.cs index 12280b6b65..430756e319 100644 --- a/src/Microsoft.AspNet.Mvc.ModelBinding/Properties/Resources.Designer.cs +++ b/src/Microsoft.AspNet.Mvc.ModelBinding/Properties/Resources.Designer.cs @@ -11,7 +11,7 @@ namespace Microsoft.AspNet.Mvc.ModelBinding = new ResourceManager("Microsoft.AspNet.Mvc.ModelBinding.Resources", typeof(Resources).GetTypeInfo().Assembly); /// - /// The value cannot be null or empty. + /// Value cannot be null or empty. /// internal static string ArgumentCannotBeNullOrEmpty { @@ -19,7 +19,7 @@ namespace Microsoft.AspNet.Mvc.ModelBinding } /// - /// The value cannot be null or empty. + /// Value cannot be null or empty. /// internal static string FormatArgumentCannotBeNullOrEmpty() { diff --git a/src/Microsoft.AspNet.Mvc.ModelBinding/Resources.resx b/src/Microsoft.AspNet.Mvc.ModelBinding/Resources.resx index a34683263e..f5e2484512 100644 --- a/src/Microsoft.AspNet.Mvc.ModelBinding/Resources.resx +++ b/src/Microsoft.AspNet.Mvc.ModelBinding/Resources.resx @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - The value cannot be null or empty. + Value cannot be null or empty. The property {0}.{1} could not be found. diff --git a/src/Microsoft.AspNet.Mvc.Razor.Host/Properties/Resources.Designer.cs b/src/Microsoft.AspNet.Mvc.Razor.Host/Properties/Resources.Designer.cs index a8eda4a1ee..2fbbab3b6c 100644 --- a/src/Microsoft.AspNet.Mvc.Razor.Host/Properties/Resources.Designer.cs +++ b/src/Microsoft.AspNet.Mvc.Razor.Host/Properties/Resources.Designer.cs @@ -11,7 +11,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Host = new ResourceManager("Microsoft.AspNet.Mvc.Razor.Host.Resources", typeof(Resources).GetTypeInfo().Assembly); /// - /// Argument cannot be null or empty. + /// Value cannot be null or empty. /// internal static string ArgumentCannotBeNullOrEmpy { @@ -19,7 +19,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Host } /// - /// Argument cannot be null or empty. + /// Value cannot be null or empty. /// internal static string FormatArgumentCannotBeNullOrEmpy() { diff --git a/src/Microsoft.AspNet.Mvc.Razor.Host/Resources.resx b/src/Microsoft.AspNet.Mvc.Razor.Host/Resources.resx index 460a42f1cb..adb2366a39 100644 --- a/src/Microsoft.AspNet.Mvc.Razor.Host/Resources.resx +++ b/src/Microsoft.AspNet.Mvc.Razor.Host/Resources.resx @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Argument cannot be null or empty. + Value cannot be null or empty. Argument must be an instance of '{0}'. diff --git a/src/Microsoft.AspNet.Mvc.Razor/Properties/Resources.Designer.cs b/src/Microsoft.AspNet.Mvc.Razor/Properties/Resources.Designer.cs index 4e6e08cd25..e8dd0ed3ae 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/Properties/Resources.Designer.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/Properties/Resources.Designer.cs @@ -11,7 +11,7 @@ namespace Microsoft.AspNet.Mvc.Razor = new ResourceManager("Microsoft.AspNet.Mvc.Razor.Resources", typeof(Resources).GetTypeInfo().Assembly); /// - /// The value cannot be null or empty. + /// Value cannot be null or empty. /// internal static string ArgumentCannotBeNullOrEmpty { @@ -19,7 +19,7 @@ namespace Microsoft.AspNet.Mvc.Razor } /// - /// The value cannot be null or empty. + /// Value cannot be null or empty. /// internal static string FormatArgumentCannotBeNullOrEmpty() { diff --git a/src/Microsoft.AspNet.Mvc.Razor/Resources.resx b/src/Microsoft.AspNet.Mvc.Razor/Resources.resx index cca4dab354..a7f976fd02 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/Resources.resx +++ b/src/Microsoft.AspNet.Mvc.Razor/Resources.resx @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - The value cannot be null or empty. + Value cannot be null or empty. Compilation for '{0}' failed: diff --git a/test/Microsoft.AspNet.Mvc.ModelBinding.Test/Metadata/AssociatedMetadataProviderTest.cs b/test/Microsoft.AspNet.Mvc.ModelBinding.Test/Metadata/AssociatedMetadataProviderTest.cs index aa494526e2..5c2c837b8b 100644 --- a/test/Microsoft.AspNet.Mvc.ModelBinding.Test/Metadata/AssociatedMetadataProviderTest.cs +++ b/test/Microsoft.AspNet.Mvc.ModelBinding.Test/Metadata/AssociatedMetadataProviderTest.cs @@ -102,14 +102,12 @@ namespace Microsoft.AspNet.Mvc.ModelBinding var provider = new TestableAssociatedMetadataProvider(); // Act & Assert - ExceptionAssert.ThrowsArgument( + ExceptionAssert.ThrowsArgumentNullOrEmpty( () => provider.GetMetadataForProperty(modelAccessor: null, containerType: typeof(object), propertyName: null), - "propertyName", - "The value cannot be null or empty."); - ExceptionAssert.ThrowsArgument( + "propertyName"); + ExceptionAssert.ThrowsArgumentNullOrEmpty( () => provider.GetMetadataForProperty(modelAccessor: null, containerType: typeof(object), propertyName: String.Empty), - "propertyName", - "The value cannot be null or empty."); + "propertyName"); } [Fact]