Added support for pasting of monetary values (#176)

Fixes #52

Description of the changes:
Added support for pasting of prefix currency symbols supported by the Windows keyboard.
yen or yuan (¥)
unspecified currency sign (¤)
Ghanaian cedi (₵)
dollar or peso ($)
colón (₡)
won (₩)
shekel (₪)
naira (₦)
Indian rupee (₹)
pound (£)
euro (€)

How changes were validated:
Manually tested each prefix currency symbol supported by the Windows keyboard and ran unit tests.
This commit is contained in:
Brandon Williams 2019-03-15 17:45:49 -07:00 committed by Daniel Belcher
parent ca15f05227
commit 4a41e37c87
5 changed files with 49 additions and 11 deletions

View file

@ -193,6 +193,33 @@ namespace CalculatorUnitTests
VERIFY_ARE_EQUAL(m_CopyPasteManager.SanitizeOperand(L"______1234___"), L"1234");
};
// Using unicode literals here until the encoding issues get figured out
TEST_METHOD(ValidatePrefixCurrencySymbols)
{
// ¥5
VERIFY_ARE_EQUAL(m_CopyPasteManager.RemoveUnwantedCharsFromWstring(L"\u00A5\u0035"), L"5");
// ¤5
VERIFY_ARE_EQUAL(m_CopyPasteManager.RemoveUnwantedCharsFromWstring(L"\u00A4\u0035"), L"5");
// ₵5
VERIFY_ARE_EQUAL(m_CopyPasteManager.RemoveUnwantedCharsFromWstring(L"\u20B5\u0035"), L"5");
// $5
VERIFY_ARE_EQUAL(m_CopyPasteManager.RemoveUnwantedCharsFromWstring(L"\u0024\u0035"), L"5");
// ₡5
VERIFY_ARE_EQUAL(m_CopyPasteManager.RemoveUnwantedCharsFromWstring(L"\u20A1\u0035"), L"5");
// ₩5
VERIFY_ARE_EQUAL(m_CopyPasteManager.RemoveUnwantedCharsFromWstring(L"\u20A9\u0035"), L"5");
// ₪5
VERIFY_ARE_EQUAL(m_CopyPasteManager.RemoveUnwantedCharsFromWstring(L"\u20AA\u0035"), L"5");
// ₦5
VERIFY_ARE_EQUAL(m_CopyPasteManager.RemoveUnwantedCharsFromWstring(L"\u20A6\u0035"), L"5");
// ₹5
VERIFY_ARE_EQUAL(m_CopyPasteManager.RemoveUnwantedCharsFromWstring(L"\u20B9\u0035"), L"5");
// £5
VERIFY_ARE_EQUAL(m_CopyPasteManager.RemoveUnwantedCharsFromWstring(L"\u00A3\u0035"), L"5");
// €5
VERIFY_ARE_EQUAL(m_CopyPasteManager.RemoveUnwantedCharsFromWstring(L"\u20AC\u0035"), L"5");
};
TEST_METHOD(ValidateTryOperandToULL)
{
unsigned long long int result = 0;