Esempio n. 1
0
 public void CannotParseUnknownZones()
 {
     foreach (string zone in new string[] { "ZT", "ZZT", "EZT", "ZST" })
     {
         try
         {
             InternetDate.Parse("Sun, 26 Feb 2006 17:52:20 " + zone);
             Assert.Fail("{0} is not a valid zone.", zone);
         }
         catch (FormatException)
         {
             continue;
         }
     }
 }
Esempio n. 2
0
 public void CannotParseBelowMinimumLength()
 {
     InternetDate.Parse("1234567890");
 }
Esempio n. 3
0
 public void CannotParseEmpty()
 {
     InternetDate.Parse(string.Empty);
 }
Esempio n. 4
0
 public void CannotParseNull()
 {
     InternetDate.Parse(null);
 }
Esempio n. 5
0
        private static void AssertParse(string expected, string input)
        {
            DateTime time = InternetDate.Parse(input);

            Assert.AreEqual(expected, time.ToUniversalTime().ToString("r"), "Input = " + input);
        }
Esempio n. 6
0
 public void NoTimeZoneDelimiter()
 {
     InternetDate.Parse("Sun,26-Feb-2006T22:52:20+0100");
 }
Esempio n. 7
0
 public void WrongLocalDifferentialLength()
 {
     InternetDate.Parse("Sun, 26 Feb 2006 22:52:20 100");
 }
Esempio n. 8
0
 public void BadLocalDifferential()
 {
     InternetDate.Parse("Sun, 26 Feb 2006 21:52:20 HHMM");
 }
Esempio n. 9
0
 public void MissingTimeZone()
 {
     InternetDate.Parse("Sun, 26 Feb 2006 21:52:20");
 }
Esempio n. 10
0
 public void EmptyTimeZone()
 {
     InternetDate.Parse("Sun, 26 Feb 2006 21:52:20 ");
 }