Fixed error message related to escaping curly braces.

This commit is contained in:
Kiran Challa 2017-01-03 14:33:36 -08:00
parent 071b616178
commit 755d436840
3 changed files with 36 additions and 36 deletions

View File

@ -363,7 +363,7 @@ namespace Microsoft.AspNetCore.Routing
} }
/// <summary> /// <summary>
/// In a route parameter, '{' and '}' must be escaped with '{{' and '}}' /// In a route parameter, '{' and '}' must be escaped with '{{' and '}}'.
/// </summary> /// </summary>
internal static string TemplateRoute_UnescapedBrace internal static string TemplateRoute_UnescapedBrace
{ {
@ -371,7 +371,7 @@ namespace Microsoft.AspNetCore.Routing
} }
/// <summary> /// <summary>
/// In a route parameter, '{' and '}' must be escaped with '{{' and '}}' /// In a route parameter, '{' and '}' must be escaped with '{{' and '}}'.
/// </summary> /// </summary>
internal static string FormatTemplateRoute_UnescapedBrace() internal static string FormatTemplateRoute_UnescapedBrace()
{ {

View File

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<root> <root>
<!-- <!--
Microsoft ResX Schema Microsoft ResX Schema
Version 2.0 Version 2.0
The primary goals of this format is to allow a simple XML format The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes various data types are done through the TypeConverter classes
associated with the data types. associated with the data types.
Example: Example:
... ado.net/XML headers & schema ... ... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader> <resheader name="version">2.0</resheader>
@ -26,36 +26,36 @@
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment> <comment>This is a comment</comment>
</data> </data>
There are any number of "resheader" rows that contain simple There are any number of "resheader" rows that contain simple
name/value pairs. name/value pairs.
Each data row contains a name, and value. The row also contains a Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture. text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the Classes that don't support this are serialized and stored with the
mimetype set. mimetype set.
The mimetype is used for serialized objects, and tells the The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly: extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below. read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64 mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64 mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter : using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
--> -->
@ -184,7 +184,7 @@
<value>The constraint entry '{0}' - '{1}' on the route '{2}' could not be resolved by the constraint resolver of type '{3}'.</value> <value>The constraint entry '{0}' - '{1}' on the route '{2}' could not be resolved by the constraint resolver of type '{3}'.</value>
</data> </data>
<data name="TemplateRoute_UnescapedBrace" xml:space="preserve"> <data name="TemplateRoute_UnescapedBrace" xml:space="preserve">
<value>In a route parameter, '{' and '}' must be escaped with '{{' and '}}'</value> <value>In a route parameter, '{' and '}' must be escaped with '{{' and '}}'.</value>
</data> </data>
<data name="TemplateRoute_OptionalParameterCanbBePrecededByPeriod" xml:space="preserve"> <data name="TemplateRoute_OptionalParameterCanbBePrecededByPeriod" xml:space="preserve">
<value>In the segment '{0}', the optional parameter '{1}' is preceded by an invalid segment '{2}'. Only a period (.) can precede an optional parameter.</value> <value>In the segment '{0}', the optional parameter '{1}' is preceded by an invalid segment '{2}'. Only a period (.) can precede an optional parameter.</value>

View File

@ -521,7 +521,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests
// Act and Assert // Act and Assert
ExceptionAssert.Throws<ArgumentException>( ExceptionAssert.Throws<ArgumentException>(
() => TemplateParser.Parse(template), () => TemplateParser.Parse(template),
"In a route parameter, '{' and '}' must be escaped with '{{' and '}}'" + Environment.NewLine + "In a route parameter, '{' and '}' must be escaped with '{{' and '}}'." + Environment.NewLine +
"Parameter name: routeTemplate"); "Parameter name: routeTemplate");
} }
@ -532,8 +532,8 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests
[InlineData("{p1}.{p2?})", "p2", ")")] [InlineData("{p1}.{p2?})", "p2", ")")]
[InlineData("{foorb?}-bar-{z}", "foorb", "-bar-")] [InlineData("{foorb?}-bar-{z}", "foorb", "-bar-")]
public void Parse_ComplexSegment_OptionalParameter_NotTheLastPart( public void Parse_ComplexSegment_OptionalParameter_NotTheLastPart(
string template, string template,
string parameter, string parameter,
string invalid) string invalid)
{ {
// Act and Assert // Act and Assert
@ -554,8 +554,8 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests
// Act and Assert // Act and Assert
ExceptionAssert.Throws<ArgumentException>( ExceptionAssert.Throws<ArgumentException>(
() => TemplateParser.Parse(template), () => TemplateParser.Parse(template),
"In the complex segment '"+ template +"', the optional parameter 'p2' is preceded by an invalid " + "In the complex segment '"+ template +"', the optional parameter 'p2' is preceded by an invalid " +
"segment '" + parameter +"'. Only valid literal to precede an optional parameter is a period (.)." + "segment '" + parameter +"'. Only valid literal to precede an optional parameter is a period (.)." +
Environment.NewLine + "Parameter name: routeTemplate"); Environment.NewLine + "Parameter name: routeTemplate");
} }
@ -708,7 +708,7 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests
{ {
ExceptionAssert.Throws<ArgumentException>( ExceptionAssert.Throws<ArgumentException>(
() => TemplateParser.Parse("{a}/{a{aa}/{z}"), () => TemplateParser.Parse("{a}/{a{aa}/{z}"),
"In a route parameter, '{' and '}' must be escaped with '{{' and '}}'" + Environment.NewLine + "In a route parameter, '{' and '}' must be escaped with '{{' and '}}'." + Environment.NewLine +
"Parameter name: routeTemplate"); "Parameter name: routeTemplate");
} }