Пример #1
0
        public void ShorthandWrapperUnitTest_CorrectQ4()
        {
            var test = ShorthandReader.Read("Q4_11");

            test.From.ShouldBe(new DateTime(2011, 10, 01));
            test.To.ShouldBe(new DateTime(2011, 12, 31));
        }
Пример #2
0
        public void ShorthandWrapperUnitTest_CenturyBorder1900()
        {
            var test = ShorthandReader.Read("Q4_60");

            test.From.ShouldBe(new DateTime(1960, 10, 01));
            test.To.ShouldBe(new DateTime(1960, 12, 31));
        }
Пример #3
0
        public void ShorthandWrapperUnitTest_CorrectQ3()
        {
            var test = ShorthandReader.Read("Q3_10");

            test.From.ShouldBe(new DateTime(2010, 07, 01));
            test.To.ShouldBe(new DateTime(2010, 09, 30));
        }
Пример #4
0
        public void ShorthandWrapperUnitTest_CorrectQ2()
        {
            var test = ShorthandReader.Read("Q2_12");

            test.From.ShouldBe(new DateTime(2012, 04, 01));
            test.To.ShouldBe(new DateTime(2012, 06, 30));
        }
Пример #5
0
        public void ShorthandWrapperUnitTest_CorrectQ1()
        {
            var test = ShorthandReader.Read("Q1_14");

            test.From.ShouldBe(new DateTime(2014, 01, 01));
            test.To.ShouldBe(new DateTime(2014, 03, 31));
        }
Пример #6
0
 public void ShorthandWrapperUnitTest_InCorrectQuarter()
 {
     Should.Throw <Exception>(() => ShorthandReader.Read("Q0_10"));
     Should.Throw <Exception>(() => ShorthandReader.Read("Q5_10"));
 }
Пример #7
0
 public void ShorthandWrapperUnitTest_WrongYear()
 {
     Should.Throw <Exception>(() => ShorthandReader.Read("Q3_100"));
     Should.Throw <Exception>(() => ShorthandReader.Read("Q3_-10"));
 }
Пример #8
0
 public void ShorthandWrapperUnitTest_NoYear()
 {
     Should.Throw <Exception>(() => ShorthandReader.Read("Q2_U9"));
 }
Пример #9
0
 public void ShorthandWrapperUnitTest_Split()
 {
     Should.Throw <Exception>(() => ShorthandReader.Read("Q"));
     Should.Throw <Exception>(() => ShorthandReader.Read("Q209"));
 }
Пример #10
0
 public void ShorthandWrapperUnitTest_IsNullOrWhiteSpace()
 {
     Should.Throw <Exception>(() => ShorthandReader.Read(null));
 }