Exemplo n.º 1
0
        public void Delta_tooManyBytes_AddByte()
        {
            // 0x18 expects 2 bytes
            Delta delta = new Delta(0x18, 95);

            Assert.That(delta.ExpectedByteCount, Is.EqualTo(2));

            // add 3 bytes - last call should throw InvalidOperationException
            delta.AddByte(0x10);
            delta.AddByte(0x20);

            Assert.That(() => delta.AddByte(0x30), Throws.InvalidOperationException);
        }
Exemplo n.º 2
0
        public void Delta_tooFewBytes_AddByte()
        {
            // 0x18 expects 2 bytes
            Delta delta = new Delta(0x18, 95);

            Assert.That(delta.ExpectedByteCount, Is.EqualTo(2));

            // add 1 byte - call to Dx should throw InvalidOperationException
            delta.AddByte(0x10);

            Assert.That(() => delta.Dx, Throws.InvalidOperationException);
        }