Пример #1
0
        public void OneByteOnlyTrue_OneBit()
        {
            IByteCreator byteCreator = new ByteCreator();

            for (int i = 0; i < 8; ++i)
            {
                byteCreator.Add(true);
            }
            Assert.AreEqual(byteCreator.IsReady, true);
            Assert.AreEqual((byte)255, byteCreator.Data);
            Assert.AreEqual(byteCreator.IsEmpty, true);
            byteCreator.Add(true);
            Assert.AreEqual((byte)128, byteCreator.Data);
            Assert.AreEqual(byteCreator.IsReady, false);
            Assert.AreEqual(byteCreator.IsEmpty, true);
        }
Пример #2
0
        public void OneBit()
        {
            IByteCreator byteCreator = new ByteCreator();

            byteCreator.Add(true);
            Assert.AreEqual(byteCreator.IsReady, false);
            Assert.AreEqual(byteCreator.IsEmpty, false);
        }
Пример #3
0
        public void OneByteMixedValue()
        {
            IByteCreator byteCreator = new ByteCreator();

            byteCreator.Add(true);
            byteCreator.Add(true);
            byteCreator.Add(true);
            byteCreator.Add(true);
            byteCreator.Add(false);
            byteCreator.Add(false);
            byteCreator.Add(false);
            byteCreator.Add(false);
            Assert.AreEqual(byteCreator.IsReady, true);
            Assert.AreEqual((byte)240, byteCreator.Data);
            Assert.AreEqual(byteCreator.IsReady, false);
            Assert.AreEqual(byteCreator.IsEmpty, true);
        }