Exemple #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;
         }
     }
 }
Exemple #2
0
 public void CannotParseBelowMinimumLength()
 {
     InternetDate.Parse("1234567890");
 }
Exemple #3
0
 public void CannotParseEmpty()
 {
     InternetDate.Parse(string.Empty);
 }
Exemple #4
0
 public void CannotParseNull()
 {
     InternetDate.Parse(null);
 }
Exemple #5
0
        private static void AssertParse(string expected, string input)
        {
            DateTime time = InternetDate.Parse(input);

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