public void TagsAndUrlsAreCoalesced()
{
DeleteZonedObjects(keene_test_hub);
var dtstart = new DateTimeWithZone(DateTime.Now, calinfo_keene.tzinfo);
var dtend = new DateTimeWithZone(dtstart.LocalTime + TimeSpan.FromHours(1), calinfo_keene.tzinfo);
var es1 = new ZonedEventStore(calinfo_keene, SourceType.ical);
es1.AddEvent(
"event",
"http://1",
"source1",
dtstart,
dtend,
"1",
"1",
false,
"cat1",
"first event",
"first location"
);
es1.Serialize();
Assert.IsTrue(calinfo_keene.eventful);
var es2 = new ZonedEventStore(calinfo_keene, SourceType.eventful);
es2.AddEvent(
"event",
"http://2",
"source2",
dtstart,
dtend,
"2",
"2",
false,
"cat2,cat2a",
"second event",
"second location"
);
es2.Serialize();
EventStore.CombineZonedEventStoresToZonelessEventStore(keene_test_hub, settings);
var es = new ZonelessEventStore(calinfo_keene).Deserialize();
Assert.That(es.events.Count == 1);
var evt = es.events.Find(e => e.title == "event");
Assert.That(evt.categories == "cat1,cat2,cat2a");
Assert.That(evt.urls_and_sources.Keys.Count == 2);
Assert.That(evt.urls_and_sources["http://1"] == "source1");
Assert.That(evt.urls_and_sources["http://2"] == "source2");
}