public void ClearBlackTest()
        {
            using var result = new Epd5in65f();
            result.Initialize(m_EPaperDisplayHardwareMock.Object);

            m_DataBuffer.Clear();

            result.ClearBlack();

            const int pixelPerByte = 2;
            var       displayBytes = result.Width / pixelPerByte * result.Height;

            const byte black         = Epd5in65fColors.Black;
            var        twoBlackPixel = result.MergePixelDataInByte(black, black);

            var validBuffer = new List <byte>
            {
                (byte)Epd5in65fCommands.DataStartTransmission1
            };

            for (int i = 0; i < displayBytes; i++)
            {
                validBuffer.Add(twoBlackPixel);
            }
            validBuffer.Add((byte)Epd5in65fCommands.DataStop);
            validBuffer.Add((byte)Epd5in65fCommands.PowerOn);
            validBuffer.Add((byte)Epd5in65fCommands.GetStatus);
            validBuffer.Add((byte)Epd5in65fCommands.DisplayRefresh);
            validBuffer.Add((byte)Epd5in65fCommands.GetStatus);

            Assert.IsTrue(m_DataBuffer.SequenceEqual(validBuffer), "Command Data Sequence is wrong");
        }
        public void TestMergePixelDataInByte()
        {
            using var result = new Epd5in65f();

            var random = new Random();

            for (int i = 0; i < 200; i++)
            {
                var b1 = (byte)random.Next(0, 0x0F);
                var b2 = (byte)random.Next(0, 0x0F);

                var oldResult = MergePixelDataInByte(b1, b2);
                var newResult = result.MergePixelDataInByte(b1, b2);

                Assert.AreEqual(oldResult, newResult, $"Merged Byte Run {i} is wrong. Expected {oldResult}, Returned {newResult}");
            }
        }