예제 #1
0
        public void GetCorrectRangeTest(string firstDate, string secondDate, string expectedRange)
        {
            DateRange range = new DateRange(DateRange.ConvertToDate(firstDate), DateRange.ConvertToDate(secondDate));

            range.FullDate = range.CreateRange(range.FirstDate, range.SecondDate);

            Assert.Equal(expectedRange, range.FullDate);
        }
예제 #2
0
        public void GetCorrectCultureEnUsTest()
        {
            var       temDate = DateTime.Now;
            DateRange range   = new DateRange(temDate, temDate.AddMonths(+1));

            range.FullDate = range.CreateRange(range.FirstDate, range.SecondDate);
            var day    = temDate.ToString("dd");
            var month  = temDate.ToString("MM");
            var month2 = temDate.AddMonths(+1).ToString("MM");
            var year   = temDate.ToString("yyyy");

            Assert.Equal(day + "." + month + " - " + day + "." + month2 + "." + year, range.FullDate);
        }