예제 #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}");
            }
        }
예제 #2
0
 public void ParseExactInvalidFormatStringTest()
 {
     WeekDate.ParseExact("2019-W10-1", DateTimeFormatInfo.InvariantInfo.FullDateTimePattern);
 }
예제 #3
0
 public void ParseExactEmptyFormatStringTest()
 {
     WeekDate.ParseExact("2019-W10-1", string.Empty);
 }
예제 #4
0
 public void ParseExactEmptySourceStringTest()
 {
     WeekDate.ParseExact(string.Empty, "d");
 }
예제 #5
0
 public void ParseExactNullFormatStringTest()
 {
     WeekDate.ParseExact("2019-W10-1", null);
 }
예제 #6
0
 public void ParseExactNullSourceStringTest()
 {
     WeekDate.ParseExact(null, "d");
 }