mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-21 05:43:10 -07:00
Merge 62bb4d4001
into 3b62a1856d
This commit is contained in:
commit
4cff3b2a99
1 changed files with 8 additions and 6 deletions
|
@ -347,13 +347,15 @@ namespace UnitConverterUnitTests
|
||||||
// Test switching of unit types
|
// Test switching of unit types
|
||||||
void UnitConverterTest::UnitConverterTestUnitTypeSwitching()
|
void UnitConverterTest::UnitConverterTestUnitTypeSwitching()
|
||||||
{
|
{
|
||||||
// Enter 57 into the from field, then switch focus to the to field (making it the new from field)
|
// Now set unit conversion to go from pounds to kilograms
|
||||||
s_unitConverter->SendCommand(Command::Five);
|
|
||||||
s_unitConverter->SendCommand(Command::Seven);
|
|
||||||
s_unitConverter->SwitchActive(wstring(L"57"));
|
|
||||||
// Now set unit conversion to go from kilograms to pounds
|
|
||||||
s_unitConverter->SetCurrentCategory(s_testWeight);
|
s_unitConverter->SetCurrentCategory(s_testWeight);
|
||||||
s_unitConverter->SetCurrentUnitTypes(s_testKilograms, s_testPounds);
|
s_unitConverter->SetCurrentUnitTypes(s_testPounds, s_testKilograms);
|
||||||
|
// Enter 5 into the from field, then switch focus to the to field (making it the new from field) (switch focus to kilograms)
|
||||||
|
s_unitConverter->SendCommand(Command::Five);
|
||||||
|
s_unitConverter->SwitchActive(wstring(L"2.26796"));
|
||||||
|
VERIFY_IS_TRUE(s_testVMCallback->CheckDisplayValues(wstring(L"5"), wstring(L"2.26796")));
|
||||||
|
VERIFY_IS_TRUE(s_testVMCallback->CheckSuggestedValues(vector<tuple<wstring, Unit>>()));
|
||||||
|
// Enter 5 again into the to field
|
||||||
s_unitConverter->SendCommand(Command::Five);
|
s_unitConverter->SendCommand(Command::Five);
|
||||||
VERIFY_IS_TRUE(s_testVMCallback->CheckDisplayValues(wstring(L"5"), wstring(L"11.0231")));
|
VERIFY_IS_TRUE(s_testVMCallback->CheckDisplayValues(wstring(L"5"), wstring(L"11.0231")));
|
||||||
VERIFY_IS_TRUE(s_testVMCallback->CheckSuggestedValues(vector<tuple<wstring, Unit>>()));
|
VERIFY_IS_TRUE(s_testVMCallback->CheckSuggestedValues(vector<tuple<wstring, Unit>>()));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue