Modifying ArgumentNullOrEmpty message to be consistent with Mvc 5 \
testing code.
This commit is contained in:
parent
7934c432c8
commit
e0116bab30
|
|
@ -11,7 +11,7 @@ namespace Microsoft.AspNet.Mvc.ModelBinding
|
||||||
= new ResourceManager("Microsoft.AspNet.Mvc.ModelBinding.Resources", typeof(Resources).GetTypeInfo().Assembly);
|
= new ResourceManager("Microsoft.AspNet.Mvc.ModelBinding.Resources", typeof(Resources).GetTypeInfo().Assembly);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The value cannot be null or empty.
|
/// Value cannot be null or empty.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string ArgumentCannotBeNullOrEmpty
|
internal static string ArgumentCannotBeNullOrEmpty
|
||||||
{
|
{
|
||||||
|
|
@ -19,7 +19,7 @@ namespace Microsoft.AspNet.Mvc.ModelBinding
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The value cannot be null or empty.
|
/// Value cannot be null or empty.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string FormatArgumentCannotBeNullOrEmpty()
|
internal static string FormatArgumentCannotBeNullOrEmpty()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="ArgumentCannotBeNullOrEmpty" xml:space="preserve">
|
<data name="ArgumentCannotBeNullOrEmpty" xml:space="preserve">
|
||||||
<value>The value cannot be null or empty.</value>
|
<value>Value cannot be null or empty.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Common_PropertyNotFound" xml:space="preserve">
|
<data name="Common_PropertyNotFound" xml:space="preserve">
|
||||||
<value>The property {0}.{1} could not be found.</value>
|
<value>The property {0}.{1} could not be found.</value>
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Host
|
||||||
= new ResourceManager("Microsoft.AspNet.Mvc.Razor.Host.Resources", typeof(Resources).GetTypeInfo().Assembly);
|
= new ResourceManager("Microsoft.AspNet.Mvc.Razor.Host.Resources", typeof(Resources).GetTypeInfo().Assembly);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Argument cannot be null or empty.
|
/// Value cannot be null or empty.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string ArgumentCannotBeNullOrEmpy
|
internal static string ArgumentCannotBeNullOrEmpy
|
||||||
{
|
{
|
||||||
|
|
@ -19,7 +19,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Host
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Argument cannot be null or empty.
|
/// Value cannot be null or empty.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string FormatArgumentCannotBeNullOrEmpy()
|
internal static string FormatArgumentCannotBeNullOrEmpy()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="ArgumentCannotBeNullOrEmpy" xml:space="preserve">
|
<data name="ArgumentCannotBeNullOrEmpy" xml:space="preserve">
|
||||||
<value>Argument cannot be null or empty.</value>
|
<value>Value cannot be null or empty.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ArgumentMustBeOfType" xml:space="preserve">
|
<data name="ArgumentMustBeOfType" xml:space="preserve">
|
||||||
<value>Argument must be an instance of '{0}'.</value>
|
<value>Argument must be an instance of '{0}'.</value>
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ namespace Microsoft.AspNet.Mvc.Razor
|
||||||
= new ResourceManager("Microsoft.AspNet.Mvc.Razor.Resources", typeof(Resources).GetTypeInfo().Assembly);
|
= new ResourceManager("Microsoft.AspNet.Mvc.Razor.Resources", typeof(Resources).GetTypeInfo().Assembly);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The value cannot be null or empty.
|
/// Value cannot be null or empty.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string ArgumentCannotBeNullOrEmpty
|
internal static string ArgumentCannotBeNullOrEmpty
|
||||||
{
|
{
|
||||||
|
|
@ -19,7 +19,7 @@ namespace Microsoft.AspNet.Mvc.Razor
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The value cannot be null or empty.
|
/// Value cannot be null or empty.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static string FormatArgumentCannotBeNullOrEmpty()
|
internal static string FormatArgumentCannotBeNullOrEmpty()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<data name="ArgumentCannotBeNullOrEmpty" xml:space="preserve">
|
<data name="ArgumentCannotBeNullOrEmpty" xml:space="preserve">
|
||||||
<value>The value cannot be null or empty.</value>
|
<value>Value cannot be null or empty.</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="CompilationFailed" xml:space="preserve">
|
<data name="CompilationFailed" xml:space="preserve">
|
||||||
<value>Compilation for '{0}' failed:</value>
|
<value>Compilation for '{0}' failed:</value>
|
||||||
|
|
|
||||||
|
|
@ -102,14 +102,12 @@ namespace Microsoft.AspNet.Mvc.ModelBinding
|
||||||
var provider = new TestableAssociatedMetadataProvider();
|
var provider = new TestableAssociatedMetadataProvider();
|
||||||
|
|
||||||
// Act & Assert
|
// Act & Assert
|
||||||
ExceptionAssert.ThrowsArgument(
|
ExceptionAssert.ThrowsArgumentNullOrEmpty(
|
||||||
() => provider.GetMetadataForProperty(modelAccessor: null, containerType: typeof(object), propertyName: null),
|
() => provider.GetMetadataForProperty(modelAccessor: null, containerType: typeof(object), propertyName: null),
|
||||||
"propertyName",
|
"propertyName");
|
||||||
"The value cannot be null or empty.");
|
ExceptionAssert.ThrowsArgumentNullOrEmpty(
|
||||||
ExceptionAssert.ThrowsArgument(
|
|
||||||
() => provider.GetMetadataForProperty(modelAccessor: null, containerType: typeof(object), propertyName: String.Empty),
|
() => provider.GetMetadataForProperty(modelAccessor: null, containerType: typeof(object), propertyName: String.Empty),
|
||||||
"propertyName",
|
"propertyName");
|
||||||
"The value cannot be null or empty.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue