formatting

This commit is contained in:
rudyhuyn 2019-05-09 02:26:12 -07:00
commit a9d4e52128
4 changed files with 17 additions and 18 deletions

View file

@ -215,7 +215,7 @@ vector<wstring> UnitConverter::StringToVector(const wstring& w, const wchar_t* d
} }
return serializedTokens; return serializedTokens;
} }
wstring UnitConverter::UnitToString(const Unit& u, const wchar_t * delimiter) wstring UnitConverter::UnitToString(const Unit& u, const wchar_t* delimiter)
{ {
wstringstream out(wstringstream::out); wstringstream out(wstringstream::out);
out << Quote(std::to_wstring(u.id)) << delimiter << Quote(u.name) << delimiter << Quote(u.abbreviation) << delimiter out << Quote(std::to_wstring(u.id)) << delimiter << Quote(u.name) << delimiter << Quote(u.abbreviation) << delimiter

View file

@ -1152,7 +1152,7 @@ void StandardCalculatorViewModel::OnMemoryClear(_In_ Object ^ memoryItemPosition
} }
} }
void StandardCalculatorViewModel::OnPropertyChanged(String^ propertyname) void StandardCalculatorViewModel::OnPropertyChanged(String ^ propertyname)
{ {
if (propertyname == IsScientificPropertyName) if (propertyname == IsScientificPropertyName)
{ {

View file

@ -833,22 +833,22 @@ TEST_METHOD(TestSupplementaryResultsWhimsicalUnits)
suggestedList.push_back(tuple<wstring, UCM::Unit>(L"", unitWhimSubsequent)); suggestedList.push_back(tuple<wstring, UCM::Unit>(L"", unitWhimSubsequent));
suggestedList.push_back(tuple<wstring, UCM::Unit>(L"", unit)); suggestedList.push_back(tuple<wstring, UCM::Unit>(L"", unit));
vm.UpdateSupplementaryResults(suggestedList); vm.UpdateSupplementaryResults(suggestedList);
WaitForSingleObjectEx(GetCurrentThread(), 1100, FALSE); WaitForSingleObjectEx(GetCurrentThread(), 1100, FALSE);
VERIFY_ARE_EQUAL((UINT)6, vm.SupplementaryResults->Size); VERIFY_ARE_EQUAL((UINT)6, vm.SupplementaryResults->Size);
while (vm.SupplementaryResults->Size > 1) while (vm.SupplementaryResults->Size > 1)
{ {
VERIFY_IS_FALSE(vm.SupplementaryResults->GetAt(0)->IsWhimsical()); VERIFY_IS_FALSE(vm.SupplementaryResults->GetAt(0)->IsWhimsical());
vm.SupplementaryResults->RemoveAt(0); vm.SupplementaryResults->RemoveAt(0);
} }
// Last item // Last item
VERIFY_IS_TRUE(vm.SupplementaryResults->GetAt(0)->Unit->GetModelUnit() == UNITWHIMSY); VERIFY_IS_TRUE(vm.SupplementaryResults->GetAt(0)->Unit->GetModelUnit() == UNITWHIMSY);
} }
TEST_METHOD(TestOnPaste) TEST_METHOD(TestOnPaste)
{ {
shared_ptr<UnitConverterMock> mock = make_shared<UnitConverterMock>(); shared_ptr<UnitConverterMock> mock = make_shared<UnitConverterMock>();
VM::UnitConverterViewModel vm(mock); VM::UnitConverterViewModel vm(mock);
// Call count is being set to 1 because we send 'CE' command as the first call in OnPaste method of the ViewModel // Call count is being set to 1 because we send 'CE' command as the first call in OnPaste method of the ViewModel
UINT callCount = 1; UINT callCount = 1;

View file

@ -60,7 +60,6 @@ namespace CalculatorUnitTests
UINT m_sendCommandCallCount; UINT m_sendCommandCallCount;
UINT m_setVMCallbackCallCount; UINT m_setVMCallbackCallCount;
UCM::Category m_curCategory; UCM::Category m_curCategory;
UCM::Unit m_curFrom; UCM::Unit m_curFrom;
UCM::Unit m_curTo; UCM::Unit m_curTo;