mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 06:13:14 -07:00
Take feedback into account
This commit is contained in:
parent
14afd77da4
commit
dde6ab2a13
2 changed files with 7 additions and 12 deletions
|
@ -343,7 +343,7 @@ String^ DateCalculatorViewModel::GetDateDiffString() const
|
|||
}
|
||||
}
|
||||
|
||||
return ref new Platform::String(result.data());
|
||||
return ref new String(result.data());
|
||||
}
|
||||
|
||||
String^ DateCalculatorViewModel::GetDateDiffStringInDays() const
|
||||
|
@ -361,7 +361,7 @@ String^ DateCalculatorViewModel::GetDateDiffStringInDays() const
|
|||
result += AppResourceProvider::GetInstance().GetResourceString(L"Date_Day")->Data();
|
||||
}
|
||||
|
||||
return ref new Platform::String(result.data());
|
||||
return ref new String(result.data());
|
||||
}
|
||||
|
||||
void DateCalculatorViewModel::OnCopyCommand(Platform::Object^ parameter)
|
||||
|
|
|
@ -494,7 +494,7 @@ namespace DateCalculationUnitTests
|
|||
}
|
||||
}
|
||||
|
||||
TEST_METHOD(DateCalcViewModelDateDiffSignTest)
|
||||
TEST_METHOD(DateCalcViewModelDateDiffIgnoreSignTest)
|
||||
{
|
||||
auto viewModel = ref new DateCalculatorViewModel();
|
||||
|
||||
|
@ -504,19 +504,14 @@ namespace DateCalculationUnitTests
|
|||
viewModel->FromDate = DateUtils::SystemTimeToDateTime(date[10]);
|
||||
viewModel->ToDate = DateUtils::SystemTimeToDateTime(date[6]);
|
||||
|
||||
auto dfd = viewModel->StrDateDiffResultInDays;
|
||||
auto dfffg = viewModel->StrDateDiffResult;
|
||||
//// check negative difference
|
||||
VERIFY_IS_FALSE(viewModel->IsDiffInDays);
|
||||
VERIFY_ARE_EQUAL(StringReference(L"305 days"), viewModel->StrDateDiffResultInDays);
|
||||
VERIFY_ARE_EQUAL(StringReference(L"10 months"), viewModel->StrDateDiffResult);
|
||||
|
||||
//// check positive difference
|
||||
viewModel->FromDate = DateUtils::SystemTimeToDateTime(date[6]);
|
||||
viewModel->ToDate = DateUtils::SystemTimeToDateTime(date[10]);
|
||||
VERIFY_IS_FALSE(viewModel->IsDiffInDays);
|
||||
VERIFY_ARE_EQUAL(StringReference(L"- 305 days"), viewModel->StrDateDiffResultInDays);
|
||||
VERIFY_ARE_EQUAL(StringReference(L"- 10 months"), viewModel->StrDateDiffResult);
|
||||
VERIFY_ARE_EQUAL(StringReference(L"305 days"), viewModel->StrDateDiffResultInDays);
|
||||
VERIFY_ARE_EQUAL(StringReference(L"10 months"), viewModel->StrDateDiffResult);
|
||||
}
|
||||
|
||||
TEST_METHOD(DateCalcViewModelDateDiffTest)
|
||||
|
@ -557,7 +552,7 @@ namespace DateCalculationUnitTests
|
|||
VERIFY_IS_NULL(viewModel->StrDateDiffResultInDays);
|
||||
}
|
||||
|
||||
TEST_METHOD(DateCalcViewModelDateDiffResultInNegativeDaysTest)
|
||||
TEST_METHOD(DateCalcViewModelDateDiffFromDateHigherThanToDate)
|
||||
{
|
||||
auto viewModel = ref new DateCalculatorViewModel();
|
||||
|
||||
|
@ -569,7 +564,7 @@ namespace DateCalculationUnitTests
|
|||
|
||||
// Assert for the result
|
||||
VERIFY_IS_TRUE(viewModel->IsDiffInDays);
|
||||
VERIFY_ARE_EQUAL(StringReference(L"- 1 day"), viewModel->StrDateDiffResult);
|
||||
VERIFY_ARE_EQUAL(StringReference(L"1 day"), viewModel->StrDateDiffResult);
|
||||
VERIFY_IS_NULL(viewModel->StrDateDiffResultInDays);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue