Exemple #1
0
        public void TestNext()
        {
            ByteArrayWrapper arrayWrapper = new ByteArrayWrapper(new byte[] { 0x01, 0x02 });

            Assert.AreEqual(true, arrayWrapper.Next());
            Assert.AreEqual(0x01, arrayWrapper.Value());
            Assert.AreEqual(true, arrayWrapper.Next());
            Assert.AreEqual(0x02, arrayWrapper.Value());
            Assert.AreEqual(false, arrayWrapper.Next());
        }
Exemple #2
0
        public void TestKeyAndValue()
        {
            ByteArrayWrapper arrayWrapper = new ByteArrayWrapper(new byte[] { 0x01, 0x02 });
            Action           action2      = () => arrayWrapper.Value();

            action2.Should().Throw <InvalidOperationException>();
            arrayWrapper.Next();
            Assert.AreEqual(0x01, arrayWrapper.Value());
            arrayWrapper.Next();
            Assert.AreEqual(0x02, arrayWrapper.Value());
        }