Skip to content

Commit

Permalink
Attempt to repro Description problems in #337
Browse files Browse the repository at this point in the history
  • Loading branch information
rianjs committed Nov 17, 2017
1 parent 57ef3b4 commit b0f1d03
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 12 deletions.
23 changes: 17 additions & 6 deletions net-core/Ical.Net.CoreUnitTests/SerializationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,12 +414,23 @@ public void JournalStatusAllCaps()
[Test]
public void TestDescription()
{
//DESCRIPTION:aaa aaaaa:\n aaaaa aaaa aaaaa aaaaaaa (aaaaa\, aaaa\, aaaaa\, TP) aaa aaa aaaaa aaaa\;\n aaa aaaaa aaaa aaaa aaaa aaaaa aaaaaa aaaaaa (aa aaaaaa\, aaaaaaa)\;\n aaaaa aaaaaa aaa aaa aaaaa aaaaaa aa\, aaaaaa aaaaaa\, aaa.\;\n\naaaa aaaa aaaaa aaa aa aaa aaa aaaaa aaaaaa aa aaa aaaa aaaaa`a aaaaa aaa.
//var foo = GetSimpleEvent();
//var serialized = new CalendarSerializer().SerializeToString(foo);

//var bar = serialized.Length;
//const string exampleEvent =
const string testCase = @"BEGIN:VCALENDAR
PRODID:-//github.com/rianjs/ical.net//NONSGML ical.net 4.0//EN
VERSION:4.0
BEGIN:VEVENT
DTEND:20171117T114135
DTSTAMP:20171117T154135Z
DTSTART:20171117T104135
DESCRIPTION:aaa aaaaa:\n aaaaa aaaa aaaaa aaaaaaa (aaaaa\, aaaa\, aaaaa\, TP) aaa aaa aaaaa aaaa\;\n aaa aaaaa aaaa aaaa aaaa aaaaa aaaaaa aaaaaa (aa aaaaaa\, aaaaaaa)\;\n aaaaa aaaaaa aaa aaa aaaaa aaaaaa aa\, aaaaaa aaaaaa\, aaa.\;\n\naaaa aaaa aaaaa aaa aa aaa aaa aaaaa aaaaaa aa aaa aaaa aaaaa`a aaaaa aaa.
SEQUENCE:0
UID:46ee3437-cb6f-40f7-8a7a-49b177908396
END:VEVENT
END:VCALENDAR";
var deserialized = Calendar.Load(testCase);
var e = deserialized.Events.First();
Assert.AreEqual(new CalDateTime(2017, 11, 17, 10, 41, 35), e.Start);
Assert.AreEqual(new CalDateTime(2017, 11, 17, 11, 41, 35), e.End);
Assert.AreEqual("aaa aaaaa:\n aaaaa aaaa aaaaa aaaaaaa (aaaaa, aaaa, aaaaa, TP) aaa aaa aaaaa aaaa;\n aaa aaaaa aaaa aaaa aaaa aaaaa aaaaaa aaaaaa (aa aaaaaa, aaaaaaa);\n aaaaa aaaaaa aaa aaa aaaaa aaaaaa aa, aaaaaa aaaaaa, aaa.;\n\naaaa aaaa aaaaa aaa aa aaa aaa aaaaa aaaaaa aa aaa aaaa aaaaa`a aaaaa aaa. ", e.Description);
}
}
}
23 changes: 17 additions & 6 deletions net-core/Ical.Net.FrameworkUnitTests/SerializationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -414,12 +414,23 @@ public void JournalStatusAllCaps()
[Test]
public void TestDescription()
{
//DESCRIPTION:aaa aaaaa:\n aaaaa aaaa aaaaa aaaaaaa (aaaaa\, aaaa\, aaaaa\, TP) aaa aaa aaaaa aaaa\;\n aaa aaaaa aaaa aaaa aaaa aaaaa aaaaaa aaaaaa (aa aaaaaa\, aaaaaaa)\;\n aaaaa aaaaaa aaa aaa aaaaa aaaaaa aa\, aaaaaa aaaaaa\, aaa.\;\n\naaaa aaaa aaaaa aaa aa aaa aaa aaaaa aaaaaa aa aaa aaaa aaaaa`a aaaaa aaa.
//var foo = GetSimpleEvent();
//var serialized = new CalendarSerializer().SerializeToString(foo);

//var bar = serialized.Length;
//const string exampleEvent =
const string testCase = @"BEGIN:VCALENDAR
PRODID:-//github.com/rianjs/ical.net//NONSGML ical.net 4.0//EN
VERSION:4.0
BEGIN:VEVENT
DTEND:20171117T114135
DTSTAMP:20171117T154135Z
DTSTART:20171117T104135
DESCRIPTION:aaa aaaaa:\n aaaaa aaaa aaaaa aaaaaaa (aaaaa\, aaaa\, aaaaa\, TP) aaa aaa aaaaa aaaa\;\n aaa aaaaa aaaa aaaa aaaa aaaaa aaaaaa aaaaaa (aa aaaaaa\, aaaaaaa)\;\n aaaaa aaaaaa aaa aaa aaaaa aaaaaa aa\, aaaaaa aaaaaa\, aaa.\;\n\naaaa aaaa aaaaa aaa aa aaa aaa aaaaa aaaaaa aa aaa aaaa aaaaa`a aaaaa aaa.
SEQUENCE:0
UID:46ee3437-cb6f-40f7-8a7a-49b177908396
END:VEVENT
END:VCALENDAR";
var deserialized = Calendar.Load(testCase);
var e = deserialized.Events.First();
Assert.AreEqual(new CalDateTime(2017,11,17,10,41,35), e.Start);
Assert.AreEqual(new CalDateTime(2017,11,17,11,41,35), e.End);
Assert.AreEqual("aaa aaaaa:\n aaaaa aaaa aaaaa aaaaaaa (aaaaa, aaaa, aaaaa, TP) aaa aaa aaaaa aaaa;\n aaa aaaaa aaaa aaaa aaaa aaaaa aaaaaa aaaaaa (aa aaaaaa, aaaaaaa);\n aaaaa aaaaaa aaa aaa aaaaa aaaaaa aa, aaaaaa aaaaaa, aaa.;\n\naaaa aaaa aaaaa aaa aa aaa aaa aaaaa aaaaaa aa aaa aaaa aaaaa`a aaaaa aaa. ", e.Description);
}
}
}

0 comments on commit b0f1d03

Please sign in to comment.