mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-24 06:55:19 -07:00
take feedback into account
This commit is contained in:
parent
ba263143f9
commit
1fbfceb0a4
2 changed files with 9 additions and 10 deletions
|
@ -36,6 +36,7 @@ using namespace Windows::UI::Xaml::Input;
|
||||||
using namespace Windows::UI::Xaml::Media;
|
using namespace Windows::UI::Xaml::Media;
|
||||||
using namespace Windows::UI::Xaml::Navigation;
|
using namespace Windows::UI::Xaml::Navigation;
|
||||||
|
|
||||||
|
// The User Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234236
|
||||||
DateCalculator::DateCalculator()
|
DateCalculator::DateCalculator()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
|
@ -394,9 +394,9 @@ namespace DateCalculationUnitTests
|
||||||
viewModel->IsDateDiffMode = true;
|
viewModel->IsDateDiffMode = true;
|
||||||
VERIFY_IS_TRUE(viewModel->IsDateDiffMode);
|
VERIFY_IS_TRUE(viewModel->IsDateDiffMode);
|
||||||
|
|
||||||
/*29.02.2008*/
|
// 29.02.2008
|
||||||
viewModel->FromDate = DateUtils::SystemTimeToDateTime(datetimeDifftest[5].startDate);
|
viewModel->FromDate = DateUtils::SystemTimeToDateTime(datetimeDifftest[5].startDate);
|
||||||
/*31.03.2008*/
|
// 31.03.2008
|
||||||
viewModel->ToDate = DateUtils::SystemTimeToDateTime(datetimeDifftest[5].endDate);
|
viewModel->ToDate = DateUtils::SystemTimeToDateTime(datetimeDifftest[5].endDate);
|
||||||
|
|
||||||
//// Assert for the result
|
//// Assert for the result
|
||||||
|
@ -404,8 +404,8 @@ namespace DateCalculationUnitTests
|
||||||
VERIFY_ARE_EQUAL(StringReference(L"31 days"), viewModel->StrDateDiffResultInDays);
|
VERIFY_ARE_EQUAL(StringReference(L"31 days"), viewModel->StrDateDiffResultInDays);
|
||||||
VERIFY_ARE_EQUAL(StringReference(L"1 month, 2 days"), viewModel->StrDateDiffResult);
|
VERIFY_ARE_EQUAL(StringReference(L"1 month, 2 days"), viewModel->StrDateDiffResult);
|
||||||
|
|
||||||
// Daylight saving time - Clock Forward
|
// Daylight Saving Time - Clock Forward
|
||||||
/*10.03.2019*/
|
// 10.03.2019
|
||||||
SYSTEMTIME startDate;
|
SYSTEMTIME startDate;
|
||||||
startDate.wYear = 2019;
|
startDate.wYear = 2019;
|
||||||
startDate.wMonth = 03;
|
startDate.wMonth = 03;
|
||||||
|
@ -414,7 +414,7 @@ namespace DateCalculationUnitTests
|
||||||
startDate.wHour = startDate.wMinute = 0;
|
startDate.wHour = startDate.wMinute = 0;
|
||||||
startDate.wSecond = startDate.wMilliseconds = 0;
|
startDate.wSecond = startDate.wMilliseconds = 0;
|
||||||
viewModel->FromDate = DateUtils::SystemTimeToDateTime(startDate);
|
viewModel->FromDate = DateUtils::SystemTimeToDateTime(startDate);
|
||||||
/*11.03.2019*/
|
// 11.03.2019
|
||||||
SYSTEMTIME endDate;
|
SYSTEMTIME endDate;
|
||||||
endDate.wYear = 2019;
|
endDate.wYear = 2019;
|
||||||
endDate.wMonth = 03;
|
endDate.wMonth = 03;
|
||||||
|
@ -423,22 +423,20 @@ namespace DateCalculationUnitTests
|
||||||
endDate.wHour = endDate.wMinute = 0;
|
endDate.wHour = endDate.wMinute = 0;
|
||||||
endDate.wSecond = endDate.wMilliseconds = 0;
|
endDate.wSecond = endDate.wMilliseconds = 0;
|
||||||
viewModel->ToDate = DateUtils::SystemTimeToDateTime(endDate);
|
viewModel->ToDate = DateUtils::SystemTimeToDateTime(endDate);
|
||||||
//// Assert for the result
|
|
||||||
VERIFY_IS_TRUE(viewModel->IsDiffInDays);
|
VERIFY_IS_TRUE(viewModel->IsDiffInDays);
|
||||||
VERIFY_ARE_EQUAL(StringReference(L"1 day"), viewModel->StrDateDiffResult);
|
VERIFY_ARE_EQUAL(StringReference(L"1 day"), viewModel->StrDateDiffResult);
|
||||||
|
|
||||||
endDate.wDay += 6;
|
endDate.wDay += 6;
|
||||||
viewModel->ToDate = DateUtils::SystemTimeToDateTime(endDate);
|
viewModel->ToDate = DateUtils::SystemTimeToDateTime(endDate);
|
||||||
//// Assert for the result
|
|
||||||
VERIFY_IS_FALSE(viewModel->IsDiffInDays);
|
VERIFY_IS_FALSE(viewModel->IsDiffInDays);
|
||||||
VERIFY_ARE_EQUAL(StringReference(L"1 week"), viewModel->StrDateDiffResult);
|
VERIFY_ARE_EQUAL(StringReference(L"1 week"), viewModel->StrDateDiffResult);
|
||||||
|
|
||||||
// Daylight saving time - Clock Backward
|
// Daylight Saving Time - Clock Backward
|
||||||
/*03.11.2019*/
|
// 03.11.2019
|
||||||
startDate.wMonth = 11;
|
startDate.wMonth = 11;
|
||||||
startDate.wDay = 03;
|
startDate.wDay = 03;
|
||||||
viewModel->FromDate = DateUtils::SystemTimeToDateTime(startDate);
|
viewModel->FromDate = DateUtils::SystemTimeToDateTime(startDate);
|
||||||
/*04.11.2019*/
|
// 04.11.2019
|
||||||
endDate.wMonth = 11;
|
endDate.wMonth = 11;
|
||||||
endDate.wDay = 04;
|
endDate.wDay = 04;
|
||||||
viewModel->ToDate = DateUtils::SystemTimeToDateTime(endDate);
|
viewModel->ToDate = DateUtils::SystemTimeToDateTime(endDate);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue