Exemplo n.º 1
0
        public void ParseExactFormatSpecifiersTest()
        {
            foreach (KeyValuePair <KeyValuePair <string, string>, WeekDate> weekDateByFormat in WeekDatesByFormats)
            {
                Assert.AreEqual(
                    weekDateByFormat.Value,
                    WeekDate.ParseExact(weekDateByFormat.Key.Value, weekDateByFormat.Key.Key),
                    $"Format: {weekDateByFormat.Key.Key}; String: {weekDateByFormat.Key.Value}");

                Assert.AreEqual(
                    weekDateByFormat.Value,
                    WeekDate.ParseExact(weekDateByFormat.Key.Value, WeekDate.Formats[weekDateByFormat.Key.Key]),
                    $"Format: {WeekDate.Formats[weekDateByFormat.Key.Key]}; String: {weekDateByFormat.Key.Value}");
            }
        }
Exemplo n.º 2
0
 public void ParseExactInvalidFormatStringTest()
 {
     WeekDate.ParseExact("2019-W10-1", DateTimeFormatInfo.InvariantInfo.FullDateTimePattern);
 }
Exemplo n.º 3
0
 public void ParseExactEmptyFormatStringTest()
 {
     WeekDate.ParseExact("2019-W10-1", string.Empty);
 }
Exemplo n.º 4
0
 public void ParseExactEmptySourceStringTest()
 {
     WeekDate.ParseExact(string.Empty, "d");
 }
Exemplo n.º 5
0
 public void ParseExactNullFormatStringTest()
 {
     WeekDate.ParseExact("2019-W10-1", null);
 }
Exemplo n.º 6
0
 public void ParseExactNullSourceStringTest()
 {
     WeekDate.ParseExact(null, "d");
 }