From 9fc7cbf13a57feb7269d56c3a6a497bf7c05dc1b Mon Sep 17 00:00:00 2001 From: Guillaume Roux Date: Mon, 4 Oct 2021 13:22:38 +0200 Subject: [PATCH] added 2nd test --- test/issue_33_test.dart | 13 ++++++++++++- test/test_resources/organizer_no_email_2.ics | 16 ++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 test/test_resources/organizer_no_email_2.ics diff --git a/test/issue_33_test.dart b/test/issue_33_test.dart index 6251a01..7e4b9b8 100644 --- a/test/issue_33_test.dart +++ b/test/issue_33_test.dart @@ -5,7 +5,7 @@ import 'test_utils.dart'; void main() { group('Issue #33', () { - test('No email in ORGANIZER', () { + test('No email in ORGANIZER - 1', () { final eventText = readFileLines('organizer_no_email.ics'); final iCal = ICalendar.fromLines(eventText); expect(iCal.data.length, 1); @@ -15,5 +15,16 @@ void main() { expect(organizer['name'], 'Joe Jackson'); expect(organizer['mail'], ''); }); + + test('No email in ORGANIZER - 2', () { + final eventText = readFileLines('organizer_no_email_2.ics'); + final iCal = ICalendar.fromLines(eventText); + expect(iCal.data.length, 1); + + final event = iCal.data[0]; + final organizer = event['organizer'] as Map; + expect(organizer['name'], 'Joe Jackson'); + expect(organizer['mail'], ''); + }); }); } diff --git a/test/test_resources/organizer_no_email_2.ics b/test/test_resources/organizer_no_email_2.ics new file mode 100644 index 0000000..2e64d76 --- /dev/null +++ b/test/test_resources/organizer_no_email_2.ics @@ -0,0 +1,16 @@ +BEGIN:VCALENDAR +VERSION:2.0 +CALSCALE:GREGORIAN +PRODID:adamgibbons/ics +METHOD:PUBLISH +BEGIN:VEVENT +UID:b11ae923-9898-44ca-8f92-ed2ebe36863f +SUMMARY:Cool event +DTSTAMP:20211004T101600Z +DTSTART:20211006T063000Z +DTEND:20211006T073000Z +DESCRIPTION:Some description +CATEGORIES:APPOINTMENT +ORGANIZER;CN=Joe Jackson +END:VEVENT +END:VCALENDAR \ No newline at end of file