예제 #1
0
        public void parseWorksWithIcalxOutputViaTextReader()
        {
            ICalParserFactory factory = new ICalParserFactory();
            Parser            parser  = factory.MakeParser(new ResourceFactoryStub(), new StatementFactoryStub());

            try {
                StringReader icalxReader = new StringReader(icalx);
                parser.Parse(icalxReader, "");
                Assert.IsTrue(true);
            }
            catch (Exception e) {
                Assert.Fail(e.ToString());
            }
        }
예제 #2
0
        public void parseWorksWithIcalxOutputViaStream()
        {
            StringReader icalxReader = new StringReader(icalx);

            ICalParserFactory factory = new ICalParserFactory();
            Parser            parser  = factory.MakeParser(new ResourceFactoryStub(), new StatementFactoryStub());

            try {
                MemoryStream stream = new MemoryStream();
                StreamWriter writer = new StreamWriter(stream);
                writer.Write(icalx);
                writer.Flush();
                stream.Position = 0;

                parser.Parse(stream, "");
                Assert.IsTrue(true);
            }
            catch (Exception e) {
                Assert.Fail(e.ToString());
            }
        }