Skip to content

Commit

Permalink
Fix multiple categories serialization problem #156
Browse files Browse the repository at this point in the history
  • Loading branch information
rianjs committed Oct 19, 2016
1 parent 38af242 commit 24e8ffc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions v2/ical.NET.UnitTests/SymmetricSerializationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Ical.Net.DataTypes;
using Ical.Net.Interfaces;
using Ical.Net.Interfaces.DataTypes;
Expand Down Expand Up @@ -200,5 +201,18 @@ public static IEnumerable<ITestCaseData> UriAttachment_TestCases()
yield return new TestCaseData("C:\\path\\to\\file.txt", new Uri("C:\\path\\to\\file.txt")).SetName("Local file path URL");
yield return new TestCaseData("\\\\uncPath\\to\\resource.txt", new Uri("\\\\uncPath\\to\\resource.txt")).SetName("UNC path URL");
}

[Test]
public void CategoriesTest()
{
var vEvent = GetSimpleEvent();
vEvent.Categories = new List<string> {"Foo", "Bar", "Baz"};
var c = new Calendar();
c.Events.Add(vEvent);

var serialized = SerializeToString(c);
var categoriesCount = Regex.Matches(serialized, "CATEGORIES").Count;
Assert.AreEqual(1, categoriesCount);
}
}
}

0 comments on commit 24e8ffc

Please sign in to comment.