Exemplo n.º 1
0
        public void Or_ByteArray_ShouldOrCurrentInstanceWithData()
        {
            var bitString = new BitString("10101010");
            var bytes     = new byte[] { 15 };         // = "00001111"

            bitString.Or(bytes);
            Assert.AreEqual("11111010", bitString.ToBinString());
        }
Exemplo n.º 2
0
        public void Or_ByteArray_ShouldDoNothing_WhenNullData()
        {
            var bitString = new BitString("10101010");

            byte[] bytes = null;
            bitString.Or(bytes);
            Assert.AreEqual("10101010", bitString.ToBinString());
        }
Exemplo n.º 3
0
        public void Or_ByteArray_ShouldDoNothing_WhenNotSameLength()
        {
            var bitString = new BitString("10101010");
            var bytes     = new byte[] { 0, 0 };

            bitString.Or(bytes);
            Assert.AreEqual("10101010", bitString.ToBinString());
        }
Exemplo n.º 4
0
        public void Or_Bitstring_ShouldDoNothing_WhenNotSameLength()
        {
            var bitString = new BitString("10010110");
            var other     = new BitString("1010");

            bitString.Or(other);
            Assert.AreEqual("10010110", bitString.ToBinString());
        }