mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
[FancyZones] HEX to RGB util (#6275)
This commit is contained in:
@@ -232,6 +232,27 @@ namespace FancyZonesUnitTests
|
||||
CustomAssert::AreEqual(firstTime, monitorInfoCopy);
|
||||
} while (next_permutation(monitorInfoPermutation.begin(), monitorInfoPermutation.end(), [](auto x, auto y) { return x.first < y.first; }));
|
||||
}
|
||||
|
||||
TEST_METHOD(TestHexToRGB_rgb)
|
||||
{
|
||||
const auto expected = RGB(163, 246, 255);
|
||||
const auto actual = HexToRGB(L"#A3F6FF");
|
||||
Assert::AreEqual(expected, actual);
|
||||
}
|
||||
|
||||
TEST_METHOD (TestHexToRGB_argb)
|
||||
{
|
||||
const auto expected = RGB(163, 246, 255);
|
||||
const auto actual = HexToRGB(L"#FFA3F6FF");
|
||||
Assert::AreEqual(expected, actual);
|
||||
}
|
||||
|
||||
TEST_METHOD (TestHexToRGB_invalid)
|
||||
{
|
||||
const auto expected = RGB(255, 255, 255);
|
||||
const auto actual = HexToRGB(L"zzz");
|
||||
Assert::AreEqual(expected, actual);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user