public void GetIconForUnknownReturnsDifferentIconForDifferentColors()
        {
            using DynamicIcons icons = new DynamicIcons();
            Icon icon1 = icons.GetIconForUnknown(FG, BG);
            Icon icon2 = icons.GetIconForUnknown(Color.Black, Color.White);

            Assert.AreNotSame(icon1, icon2);
        }
        public void GetIconForNumberReturnsSameIconForSameInput()
        {
            using DynamicIcons icons = new DynamicIcons();
            Icon icon1 = icons.GetIconForNumber(42, FG, BG);
            Icon icon2 = icons.GetIconForNumber(42, FG, BG);

            Assert.AreSame(icon1, icon2);
        }
        public void GetIconForUnknownReturnsSameIconForSameColors()
        {
            using DynamicIcons icons = new DynamicIcons();
            Icon icon1 = icons.GetIconForUnknown(FG, BG);
            Icon icon2 = icons.GetIconForUnknown(FG, BG);

            Assert.AreSame(icon1, icon2);
        }
        public void GetIconForNumberReturnsDifferentIconsForDifferentColors()
        {
            using DynamicIcons icons = new DynamicIcons();
            Icon icon1 = icons.GetIconForNumber(42, FG, BG);
            Icon icon2 = icons.GetIconForNumber(42, Color.Blue, Color.Purple);

            Assert.AreNotSame(icon1, icon2);
        }
        public void GetIconForNumberReturnsIconShowingThreeDigits()
        {
            using DynamicIcons icons = new DynamicIcons();
            Icon icon = icons.GetIconForNumber(188, FG, BG);

            Assert.AreEqual(16, icon.Width);
            Assert.AreEqual(16, icon.Height);
            AssertIconHasPixels(new ushort[16]
            {
                0x0000, 0x79E4, 0x4924, 0x4924, 0x4924, 0x4924, 0x4924, 0x79E4,
                0x4924, 0x4924, 0x4924, 0x4924, 0x4924, 0x79E4, 0x0000, 0x0000
            },
                                icon);
        }
        public void ResetClearsInternalCacheOfPreviouslyRenderedIcons()
        {
            using DynamicIcons icons = new DynamicIcons();
            Icon unknownIcon1 = icons.GetIconForUnknown(FG, BG);
            Icon numberIcon1  = icons.GetIconForNumber(42, FG, BG);

            icons.Reset();

            Icon unknownIcon2 = icons.GetIconForUnknown(FG, BG);
            Icon numberIcon2  = icons.GetIconForNumber(42, FG, BG);

            Assert.AreNotSame(unknownIcon1, unknownIcon2);
            Assert.AreNotSame(numberIcon1, numberIcon2);
        }
        public void GetIconForUnknownReturnsIconShowingSingleX()
        {
            using DynamicIcons icons = new DynamicIcons();
            Icon icon = icons.GetIconForUnknown(FG, BG);

            Assert.AreEqual(16, icon.Width);
            Assert.AreEqual(16, icon.Height);
            AssertIconHasPixels(new ushort[16]
            {
                0x0000, 0x0420, 0x0420, 0x0240, 0x0240, 0x0180, 0x0180, 0x0180,
                0x0180, 0x0180, 0x0240, 0x0240, 0x0420, 0x0420, 0x0000, 0x0000
            },
                                icon);
        }