Skip to content

Commit

Permalink
Merge pull request #215 from ilya-murzinov/ClearDateTest
Browse files Browse the repository at this point in the history
Clear date test
  • Loading branch information
JakeGinnivan committed Feb 9, 2014
2 parents 533934b + 89f3c8e commit 3c13f11
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ protected override void ExecuteTestRun(WindowsFramework framework)
SelectInputControls();
RunTest(() => GetDate(DateTime.Today), WindowsFramework.WinForms);
RunTest(() => GetDate(null), WindowsFramework.Wpf, WindowsFramework.Silverlight);
RunTest(SetDate);
RunTest(SetDate);
RunTest(ClearDate, WindowsFramework.Wpf, WindowsFramework.WinForms);
}

private void GetDate(DateTime? defaultTime)
Expand All @@ -33,6 +34,17 @@ private void SetDate()
Assert.Equal(changedDate, dateTimePicker.Date);
}

private void ClearDate()
{
var dateTimePicker = MainWindow.Get<DateTimePicker>("DatePicker");
var date = dateTimePicker.Date;
dateTimePicker.Date = null;

//Checks that date in Win32 DateTimePicker didn't change, but date in WPF DateTimePicker was cleared
Assert.Equal(dateTimePicker.Framework == WindowsFramework.Wpf ? null : date,
dateTimePicker.Date);
}

protected override IEnumerable<WindowsFramework> SupportedFrameworks()
{
yield return WindowsFramework.WinForms;
Expand Down

0 comments on commit 3c13f11

Please sign in to comment.