Esempio n. 1
0
        public void RFC3389toDotNet(string input, DateTime date)
        {
            Rfc3389DateTime dateTime = new Rfc3389DateTime(input);
            DateTime        rfc      = dateTime.ToDateTime();

            Assert.That(rfc, Is.EqualTo(date), "Format - " + input);
        }
        public void Test_07()
        {
// vevent[6].dtstart
            string test           = nodes.GetNameByPosition("vevent", 6).Nodes["dtstart"].Value;
            string testDateTime   = new Rfc3389DateTime(test).ToString();
            string resultDateTime = new Rfc3389DateTime("2007-05-01T21:30+08:00").ToString();

            Assert.That(testDateTime, Is.EqualTo(resultDateTime), "Should find a date from text node - Year, month, day and time with time zone offset");
        }
Esempio n. 3
0
        public void Test_04()
        {
// vevent[0].dtend
            string test           = nodes.GetNameByPosition("vevent", 0).Nodes["dtend"].Value;
            string testDateTime   = new Rfc3389DateTime(test).ToString();
            string resultDateTime = new Rfc3389DateTime("2007-09-09").ToString();

            Assert.That(testDateTime, Is.EqualTo(resultDateTime), "The dtend is a singular value");
        }
        public void Test_03()
        {
// vcard[2].rev
            string test           = nodes.GetNameByPosition("vcard", 2).Nodes["rev"].Value;
            string testDateTime   = new Rfc3389DateTime(test).ToString();
            string resultDateTime = new Rfc3389DateTime("20070501T1130").ToString();

            Assert.That(testDateTime, Is.EqualTo(resultDateTime), "Should find a date from text node - ISO standard date format");
        }
        public void Test_06()
        {
// vevent[5].dtstart
            string test           = nodes.GetNameByPosition("vevent", 5).Nodes["dtstart"].Value;
            string testDateTime   = new Rfc3389DateTime(test).ToString();
            string resultDateTime = new Rfc3389DateTime("20070501t113015z").ToString();

            Assert.That(testDateTime, Is.EqualTo(resultDateTime), "Should find a date from text node - lowercase punctuation");
        }
        public void Test_06()
        {
// vevent[5].dtstart
            string test           = nodes.GetNameByPosition("vevent", 5).Nodes["dtstart"].Value;
            string testDateTime   = new Rfc3389DateTime(test).ToString();
            string resultDateTime = new Rfc3389DateTime("2007-05-01T21:30:00Z").ToString();

            Assert.That(testDateTime, Is.EqualTo(resultDateTime), "Should find a date from text node - UTC Year, month, day and time");
        }
Esempio n. 7
0
        public void Test_06()
        {
// vevent[4].dtstart
            string test           = nodes.GetNameByPosition("vevent", 4).Nodes["dtstart"].Value;
            string testDateTime   = new Rfc3389DateTime(test).ToString();
            string resultDateTime = new Rfc3389DateTime("2007-05-01T21:30").ToString();

            Assert.That(testDateTime, Is.EqualTo(resultDateTime), "The dtstart from a HTML5 time element");
        }
        public void Test_05()
        {
// vcard[4].rev
            string test           = nodes.GetNameByPosition("vcard", 4).Nodes["rev"].Value;
            string testDateTime   = new Rfc3389DateTime(test).ToString();
            string resultDateTime = new Rfc3389DateTime("2007-05-01T21:30Z").ToString();

            Assert.That(testDateTime, Is.EqualTo(resultDateTime), "Should find a date from text node - UTC Year, month, day and time");
        }
Esempio n. 9
0
        public void Test_03()
        {
// vcard[0].rev
            string test           = nodes.GetNameByPosition("vcard", 0).Nodes["rev"].Value;
            string testDateTime   = new Rfc3389DateTime(test).ToString();
            string resultDateTime = new Rfc3389DateTime("2008-01-01T13:45:00").ToString();

            Assert.That(testDateTime, Is.EqualTo(resultDateTime), "Should find rev value even if class attribute has multiple values");
        }
Esempio n. 10
0
        public void Test_08()
        {
// vcard[7].rev
            string test           = nodes.GetNameByPosition("vcard", 7).Nodes["rev"].Value;
            string testDateTime   = new Rfc3389DateTime(test).ToString();
            string resultDateTime = new Rfc3389DateTime("2007-05-01T21:30:00+08:00").ToString();

            Assert.That(testDateTime, Is.EqualTo(resultDateTime), "Should find a date from text node - Year, month, day and time with time zone offset");
        }
Esempio n. 11
0
        public void Test_02()
        {
// vcard[1].rev
            string test           = nodes.GetNameByPosition("vcard", 1).Nodes["rev"].Value;
            string testDateTime   = new Rfc3389DateTime(test).ToString();
            string resultDateTime = new Rfc3389DateTime("2007-05").ToString();

            Assert.That(testDateTime, Is.EqualTo(resultDateTime), "Should find a date from text node - Year and month");
        }
Esempio n. 12
0
        public void Test_06()
        {
// vcard[0].rev
            string test           = nodes.GetNameByPosition("vcard", 0).Nodes["rev"].Value;
            string testDateTime   = new Rfc3389DateTime(test).ToString();
            string resultDateTime = new Rfc3389DateTime("2008-01-01T13:45:00").ToString();

            Assert.That(testDateTime, Is.EqualTo(resultDateTime), "The rev is a singular value");
        }
Esempio n. 13
0
        public void Test_03()
        {
// vcard[0].bday
            string test           = nodes.GetNameByPosition("vcard", 0).Nodes["bday"].Value;
            string testDateTime   = new Rfc3389DateTime(test).ToString();
            string resultDateTime = new Rfc3389DateTime("2000-01-01T00:00:00-0800").ToString();

            Assert.That(testDateTime, Is.EqualTo(resultDateTime), "The bday (birthday) is a singular value");
        }
Esempio n. 14
0
        public void Test_05()
        {
// vcard[4].rev
            string test           = nodes.GetNameByPosition("vcard", 4).Nodes["rev"].Value;
            string testDateTime   = new Rfc3389DateTime(test).ToString();
            string resultDateTime = new Rfc3389DateTime("20070501T113015Z").ToString();

            Assert.That(testDateTime, Is.EqualTo(resultDateTime), "Should find a date from text node - uppercase punctuation");
        }
        public void Test_09()
        {
// vevent[8].dtstart
            string test           = nodes.GetNameByPosition("vevent", 8).Nodes["dtstart"].Value;
            string testDateTime   = new Rfc3389DateTime(test).ToString();
            string resultDateTime = new Rfc3389DateTime("2007-05-01T21:30:00.0150").ToString();

            Assert.That(testDateTime, Is.EqualTo(resultDateTime), "Should find a date from text node - Year, month, day and time with decimal fraction of a second");
        }
        public void Test_08()
        {
// vevent[7].dtstart
            string test           = nodes.GetNameByPosition("vevent", 7).Nodes["dtstart"].Value;
            string testDateTime   = new Rfc3389DateTime(test).ToString();
            string resultDateTime = new Rfc3389DateTime("20070501T11:30:25").ToString();

            Assert.That(testDateTime, Is.EqualTo(resultDateTime), "Should find a date from text node - mixed punctuation");
        }
        public void Test_03()
        {
// vevent[2].dtstart
            string test           = nodes.GetNameByPosition("vevent", 2).Nodes["dtstart"].Value;
            string testDateTime   = new Rfc3389DateTime(test).ToString();
            string resultDateTime = new Rfc3389DateTime("2007-05-01").ToString();

            Assert.That(testDateTime, Is.EqualTo(resultDateTime), "Should find a date from text node - Year, month and day");
        }
        public void Test_02()
        {
// vevent[1].dtstart
            string test           = nodes.GetNameByPosition("vevent", 1).Nodes["dtstart"].Value;
            string testDateTime   = new Rfc3389DateTime(test).ToString();
            string resultDateTime = new Rfc3389DateTime("20080121").ToString();

            Assert.That(testDateTime, Is.EqualTo(resultDateTime), "Should find a date from text node - ISO extended date format");
        }
Esempio n. 19
0
        public void Test_04()
        {
// vevent[2].dtend
            string test           = nodes.GetNameByPosition("vevent", 2).Nodes["dtend"].Value;
            string testDateTime   = new Rfc3389DateTime(test).ToString();
            string resultDateTime = new Rfc3389DateTime("2008-08-18T16:00:00-01").ToString();

            Assert.That(testDateTime, Is.EqualTo(resultDateTime), "The dtend from a HTML5 time element");
        }
        public void Test_04()
        {
// vevent[3].dtstart
            string test           = nodes.GetNameByPosition("vevent", 3).Nodes["dtstart"].Value;
            string testDateTime   = new Rfc3389DateTime(test).ToString();
            string resultDateTime = new Rfc3389DateTime("20070501T113015").ToString();

            Assert.That(testDateTime, Is.EqualTo(resultDateTime), "Should find a date from text node - ISO standard date format");
        }
Esempio n. 21
0
        public void Test_07()
        {
// vcard[6].bday
            string test           = nodes.GetNameByPosition("vcard", 6).Nodes["bday"].Value;
            string testDateTime   = new Rfc3389DateTime(test).ToString();
            string resultDateTime = new Rfc3389DateTime("2007-05-01T21:30:00+08:00").ToString();

            Assert.That(testDateTime, Is.EqualTo(resultDateTime), "The bday or birthday from a HTML5 time element");
        }
Esempio n. 22
0
        public void Test_10()
        {
// vevent[0].last-modified
            string test           = nodes.GetNameByPosition("vevent", 0).Nodes["last-modified"].Value;
            string testDateTime   = new Rfc3389DateTime(test).ToString();
            string resultDateTime = new Rfc3389DateTime("2007-05-02").ToString();

            Assert.That(testDateTime, Is.EqualTo(resultDateTime), "The last-modified is a singular value");
        }
Esempio n. 23
0
        public void Test_03()
        {
// hresume[0].education[0].dtend
            string test           = nodes.GetNameByPosition("hresume", 0).Nodes.GetNameByPosition("education", 0).Nodes["dtend"].Value;
            string testDateTime   = new Rfc3389DateTime(test).ToString();
            string resultDateTime = new Rfc3389DateTime("1992").ToString();

            Assert.That(testDateTime, Is.EqualTo(resultDateTime), "The dtend value from hCalendar");
        }
Esempio n. 24
0
        public void Test_07()
        {
// vcard[6].rev
            string test           = nodes.GetNameByPosition("vcard", 6).Nodes["rev"].Value;
            string testDateTime   = new Rfc3389DateTime(test).ToString();
            string resultDateTime = new Rfc3389DateTime("2007-05-01T113025").ToString();

            Assert.That(testDateTime, Is.EqualTo(resultDateTime), "Should find a date from text node - mixed punctuation");
        }
Esempio n. 25
0
        public void Test_02()
        {
// vevent[0].dtend
            string test           = nodes.GetNameByPosition("vevent", 0).Nodes["dtend"].Value;
            string testDateTime   = new Rfc3389DateTime(test).ToString();
            string resultDateTime = new Rfc3389DateTime("2009-07-26T10").ToString();

            Assert.That(testDateTime, Is.EqualTo(resultDateTime), "With the value class pattern the results should contain a time");
        }
        public void Test_01()
        {
// vevent[0].dtstart
            string test           = nodes.GetNameByPosition("vevent", 0).Nodes["dtstart"].Value;
            string testDateTime   = new Rfc3389DateTime(test).ToString();
            string resultDateTime = new Rfc3389DateTime("2007-06-16T09:00:00+00:00").ToString();

            Assert.That(testDateTime, Is.EqualTo(resultDateTime), "The included dtstart value");
        }
Esempio n. 27
0
        public void RFC3389toISO(string input, string iso)
        {
            Rfc3389DateTime dateTime = new Rfc3389DateTime(input);

            Assert.That(dateTime.ToString(), Is.EqualTo(iso), "Format - " + input);
        }