mirror of
https://github.com/Microsoft/calculator.git
synced 2025-07-31 03:50:02 -07:00
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:
parent
ca15f05227
commit
4a41e37c87
5 changed files with 49 additions and 11 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue