public void testError() { string icalString = @"BEGIN:VCALENDAR METHOD:REQUEST BEGIN:VEVENT SEQUENCE:2 ATTENDEE;CN--------<error here>Libby Miller:mailto:[email protected] DTSTAMP:20030109T123909Z SUMMARY:IRC Meet UID:EB825E41-23CE-11D7-B93D-003065B0C95E ORGANIZER;CN=Damian Steer:mailto:[email protected] DTSTART; TZID=/softwarestudio.org/Olson_20011030_5/Europe/London:20030115T180000 DURATION:PT1H BEGIN:VALARM ATTACH;VALUE=URI:Ping TRIGGER;VALUE=DURATION:-PT10M ACTION:AUDIO END:VALARM END:VEVENT BEGIN:VTIMEZONE TZID:/softwarestudio.org/Olson_20011030_5/Europe/London X-LIC-LOCATION:Europe/London BEGIN:STANDARD TZOFFSETFROM:+0100 TZOFFSETTO:+0000 TZNAME:GMT DTSTART:19701025T020000 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10 END:STANDARD BEGIN:DAYLIGHT TZOFFSETFROM:+0000 TZOFFSETTO:+0100 TZNAME:BST DTSTART:19700329T010000 RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3 END:DAYLIGHT END:VTIMEZONE END:VCALENDAR "; RDFEmitter emitter = new RDFEmitter(); Parser parser = new Parser(new StringReader(icalString), emitter); parser.Parse(); Console.WriteLine(emitter.Rdf); Assert.True(parser.HasErrors); }
public void testParser_testsuite() { System.IO.Directory.CreateDirectory(resultDir); for (int i = 0; i < testcases.Length; ++i) { RDFEmitter emitter = new RDFEmitter(); RQLEmitter rqlEmitter = new RQLEmitter(); StreamReader reader = new StreamReader(testcaseDir + testcases[i] + icalExt); StreamReader rqlReader = new StreamReader(testcaseDir + testcases[i] + icalExt); Parser parser = new Parser(reader, emitter); Parser rqlParser = new Parser(rqlReader, rqlEmitter); parser.Parse(); rqlParser.Parse(); StreamWriter writer = new StreamWriter(resultDir + testcases[i] + rdfExt); StreamWriter rqlWriter = new StreamWriter(resultDir + testcases[i] + rqlExt); writer.WriteLine(emitter.Rdf); rqlWriter.WriteLine(String.Format(rqlEmitter.Rql, "icaltest")); writer.Close(); reader.Close(); rqlWriter.Close(); rqlReader.Close(); } }
public ICalParser(SemPlan.Spiral.XsltParser.XsltParser xsltParser, Dereferencer dereferencer) { itsXsltParser = xsltParser; itsEmitter = new RDFEmitter(); itsDereferencer = dereferencer; }