Ejemplo n.º 1
0
        private void ParseValidCsvInput()
        {
            var data = new List <string>()
            {
                "\"NM V2,3/IA-IK Z 354\",\"15.03.2016\",\"13:20:00\",\"15.03.2016\",\"14:50:00\",\"Aus\",\"Aus\",\"15.03.2016\",\"07:10:00\",,,,,,\"\",,\"Z 354\",\"Normal\",\"Aus\",,\"Normal\",\"2\""
            };

            var vcard = CsvVCardConverter.ParseCsv(data).First();

            Assert.Equal("NM V2,3/IA-IK Z 354", vcard.Title);
            Assert.Equal(new DateTime(2016, 03, 15, 13, 20, 00), vcard.Start);
            Assert.Equal(new DateTime(2016, 03, 15, 14, 50, 00), vcard.End);
            Assert.Equal("Z 354", vcard.Room);
        }
Ejemplo n.º 2
0
        public async Task <List <CalendarEvent> > LoadCalendar(string studentNumber)
        {
            List <string> csv;

            try
            {
                var link = await GetCsvLink(studentNumber);

                csv = await GetCsvData(link);
            }
            catch (System.Exception ex)
            {
                log.LogError("error downloading data", ex);
                throw;
            }

            return(CsvVCardConverter.ParseCsv(csv));
        }