private static void doTest(String contents,
                                   String description,
                                   String summary,
                                   String location,
                                   String startString,
                                   String endString,
                                   String organizer,
                                   String[] attendees,
                                   double latitude,
                                   double longitude)
        {
            var fakeResult = new ZXing.Result(contents, null, null, BarcodeFormat.QR_CODE);
            var result     = ResultParser.parseResult(fakeResult);

            Assert.AreEqual(ParsedResultType.CALENDAR, result.Type);
            var calResult = (CalendarParsedResult)result;

            Assert.AreEqual(description, calResult.Description);
            Assert.AreEqual(summary, calResult.Summary);
            Assert.AreEqual(location, calResult.Location);
            Assert.AreEqual(startString, calResult.Start.ToString(DATE_TIME_FORMAT));
            Assert.AreEqual(endString, calResult.End == null ? null : calResult.End.Value.ToString(DATE_TIME_FORMAT));
            Assert.AreEqual(organizer, calResult.Organizer);
            Assert.IsTrue(AddressBookParsedResultTestCase.AreEqual(attendees, calResult.Attendees));
            assertEqualOrNaN(latitude, calResult.Latitude);
            assertEqualOrNaN(longitude, calResult.Longitude);
        }
Beispiel #2
0
        private static void doTest(String contents,
                                   String[] numbers,
                                   String subject,
                                   String body,
                                   String[] vias)
        {
            ZXing.Result fakeResult = new ZXing.Result(contents, null, null, BarcodeFormat.QR_CODE);
            ParsedResult result     = ResultParser.parseResult(fakeResult);

            Assert.AreEqual(ParsedResultType.SMS, result.Type);
            SMSParsedResult smsResult = (SMSParsedResult)result;

            Assert.IsTrue(AddressBookParsedResultTestCase.AreEqual(numbers, smsResult.Numbers));
            Assert.AreEqual(subject, smsResult.Subject);
            Assert.AreEqual(body, smsResult.Body);
            Assert.IsTrue(AddressBookParsedResultTestCase.AreEqual(vias, smsResult.Vias));
        }