示例#1
0
        public void Test_That_CalculateSpanBetweenTwoDates_Returns_A_Correct_Span_When_Given_Two_Known_Dates()
        {
            bool isFortnight; // Mock
            DateTime d1 = new DateTime(2012, 8, 13);
            DateTime d2 = new DateTime(2012, 8, 20);

            ProcessDate pd = new ProcessDate();
            int daySpan = pd.CalculateSpanBetweenTwoDates(d1, d2, out isFortnight);
            Assert.IsTrue(daySpan == 7);
        }
示例#2
0
 private void dpickerToDate_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
 {
     bool isFortnight;
     ProcessDate pd = new ProcessDate();
     try
     {
         textBox1.Text = pd.CalculateSpanBetweenTwoDates((DateTime)dpickerStartDate.SelectedDate, (DateTime)dpickerToDate.SelectedDate, out isFortnight).ToString();
         textBox2.Text = isFortnight.ToString();
     }
     catch (Exception) {}
 }
示例#3
0
 public void Setup()
 {
     pd = new ProcessDate();
 }