Use only NumberBase to represent radix in CalcViewModel (#797)

This commit is contained in:
Rudy Huyn 2019-11-14 07:09:17 -08:00 committed by Matt Cooley
parent b9b0e068cd
commit 1380c7ed83
8 changed files with 46 additions and 54 deletions

View file

@ -891,13 +891,13 @@ namespace CalculatorUnitTests
};
ValidateViewModelByCommands(m_viewModel, items, true);
m_viewModel->OnMemoryButtonPressed();
m_viewModel->SwitchProgrammerModeBase(RADIX_TYPE::OCT_RADIX);
m_viewModel->SwitchProgrammerModeBase(NumberBase::OctBase);
MemoryItemViewModel ^ memorySlotOct = (MemoryItemViewModel ^) m_viewModel->MemorizedNumbers->GetAt(0);
VERIFY_ARE_EQUAL(Platform::StringReference(L"377"), Utils::GetStringValue(memorySlotOct->Value));
m_viewModel->SwitchProgrammerModeBase(RADIX_TYPE::DEC_RADIX);
m_viewModel->SwitchProgrammerModeBase(NumberBase::DecBase);
MemoryItemViewModel ^ memorySlotDec = (MemoryItemViewModel ^) m_viewModel->MemorizedNumbers->GetAt(0);
VERIFY_ARE_EQUAL(Platform::StringReference(L"255"), Utils::GetStringValue(memorySlotDec->Value));
m_viewModel->SwitchProgrammerModeBase(RADIX_TYPE::BIN_RADIX);
m_viewModel->SwitchProgrammerModeBase(NumberBase::BinBase);
MemoryItemViewModel ^ memorySlotBin = (MemoryItemViewModel ^) m_viewModel->MemorizedNumbers->GetAt(0);
VERIFY_ARE_EQUAL(Platform::StringReference(L"1111 1111"), Utils::GetStringValue(memorySlotBin->Value));
}