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); }
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) {} }
public void Setup() { pd = new ProcessDate(); }