Fix typo in resource string

Signed-off-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
This commit is contained in:
JoshLove-msft 2021-01-21 14:52:03 -08:00 committed by Jon Skeet
parent 7debdc1513
commit 9c52e6c85e
3 changed files with 10 additions and 2 deletions

View File

@ -70,7 +70,7 @@ namespace CloudNative.CloudEvents {
}
/// <summary>
/// Looks up a localized string similar to The &apos;contenttype&apos; attribute value must be a content-type expression compliant with RFC2046.
/// Looks up a localized string similar to The &apos;datacontenttype&apos; attribute value must be a content-type expression compliant with RFC2046.
/// </summary>
internal static string ErrorContentTypeIsNotRFC2046 {
get {

View File

@ -121,7 +121,7 @@
<value>Null values cannot be added as attributes</value>
</data>
<data name="ErrorContentTypeIsNotRFC2046" xml:space="preserve">
<value>The 'contenttype' attribute value must be a content-type expression compliant with RFC2046</value>
<value>The 'datacontenttype' attribute value must be a content-type expression compliant with RFC2046</value>
</data>
<data name="ErrorContentTypeUnspecified" xml:space="preserve">
<value>The 'datacontenttype' attribute value must be specified</value>

View File

@ -29,6 +29,14 @@ namespace CloudNative.CloudEvents.UnitTests
Assert.StartsWith(Strings.ErrorContentTypeUnspecified, exception.Message);
}
[Fact]
void Invalid_ContentType_Throws()
{
var cloudEvent = CreateEmptyCloudEvent();
var exception = Assert.Throws<InvalidOperationException>(() => cloudEvent.GetAttributes().Add("datacontenttype", "text/html; charset: windows-1255"));
Assert.StartsWith(Strings.ErrorContentTypeIsNotRFC2046, exception.Message);
}
static CloudEvent CreateEmptyCloudEvent() =>
new CloudEvent(CloudEventsSpecVersion.V1_0, "type",
new Uri("https://source"), "subject", "id", DateTime.UtcNow);