Skip to content

Commit

Permalink
Merge pull request #517 from rianjs/ArrayParameterBug
Browse files Browse the repository at this point in the history
Array parameter bug
  • Loading branch information
rianjs committed Apr 10, 2021
2 parents 9f5a5dc + f7d9082 commit 954b675
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
20 changes: 9 additions & 11 deletions net-core/Ical.Net.CoreUnitTests/SerializationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,6 @@ public void TimeZoneSerialize()
var serializer = new CalendarSerializer();
var serializedCalendar = serializer.SerializeToString(cal);

Console.Write(serializedCalendar);

var vTimezone = InspectSerializedSection(serializedCalendar, "VTIMEZONE", new[] { "TZID:" + tz.TzId });
var o = tzi.BaseUtcOffset.ToString("hhmm", CultureInfo.InvariantCulture);

Expand Down Expand Up @@ -261,7 +259,6 @@ public void EventPropertiesSerialized()
var serializer = new CalendarSerializer();
var serializedCalendar = serializer.SerializeToString(cal);

Console.Write(serializedCalendar);
Assert.IsTrue(serializedCalendar.StartsWith("BEGIN:VCALENDAR"));
Assert.IsTrue(serializedCalendar.EndsWith("END:VCALENDAR" + SerializationConstants.LineBreak));

Expand Down Expand Up @@ -317,12 +314,13 @@ public void AttendeesSerialized()
evt.Organizer = new Organizer(org);

evt.Attendees.AddRange(_attendees);

// However a bug, when a participation value is changed, ultimately re-serialises as an array (PARTSTAT=ACCEPTED,DECLINED)
evt.Attendees[0].ParticipationStatus = EventParticipationStatus.Declined;

var serializer = new CalendarSerializer();
var serializedCalendar = serializer.SerializeToString(cal);

Console.Write(serializedCalendar);

var vEvt = InspectSerializedSection(serializedCalendar, "VEVENT", new[] { "ORGANIZER:" + org });

foreach (var a in evt.Attendees)
Expand Down Expand Up @@ -422,11 +420,11 @@ public void UnicodeDescription()
DTEND;TZID=Europe/Helsinki:20160707T140000
SUMMARY:Some summary
UID:[email protected]
DESCRIPTION:Key points:\n• Some text (text,
, text\, text\, TP) some text\;\n• some tex
t Some text (Text\, Text)\;\n• Some tex
DESCRIPTION:Key points:\n Some text (text,
, text\, text\, TP) some text\;\n some tex
t Some text (Text\, Text)\;\n Some tex
t some text\, some text\, text.\;\n\nsome te
xt some tex‘t some text.
xt some text some text.
ORGANIZER;X-CONFLUENCE-USER-KEY=ff801df01547101c6720006;CN=Some
user;CUTYPE=INDIVIDUAL:mailto:[email protected]
CREATED:20160627T123608Z
Expand All @@ -441,8 +439,8 @@ public void UnicodeDescription()
var deserializedEvent = Calendar.Load<CalendarEvent>(ics).Single();

Assert.IsTrue(deserializedEvent.Description.Contains("\t"));
Assert.IsTrue(deserializedEvent.Description.Contains("•"));
Assert.IsTrue(deserializedEvent.Description.Contains("‘"));
Assert.IsTrue(deserializedEvent.Description.Contains(""));
Assert.IsTrue(deserializedEvent.Description.Contains(""));
}

[Test]
Expand Down
1 change: 1 addition & 0 deletions net-core/Ical.Net/CalendarParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public override void CopyFrom(ICopyable c)

public virtual void SetValue(string value)
{
_values.Clear();
_values.Add(value);
}

Expand Down

0 comments on commit 954b675

Please sign in to comment.