示例#1
0
        public void Bintest()
        {
            int[] imp1 = { 1, 0, 1, 0 };
            BooleanAlgebra.BinaryArray bin1 = new BooleanAlgebra.BinaryArray(imp1);
            Console.WriteLine(bin1.ToString());

            int[] imp2 = { 1, 0, 1, 1 };
            BooleanAlgebra.BinaryArray bin2 = new BooleanAlgebra.BinaryArray(imp2);
            Console.WriteLine(bin2.ToString());

            int[] imp3 = { 1, 0, 1, 0 };
            BooleanAlgebra.BinaryArray bin3 = new BooleanAlgebra.BinaryArray(imp3);
            Console.WriteLine(bin3.ToString());

            int[] imp4 = { 0, 0, 1, 1 };
            BooleanAlgebra.BinaryArray bin4 = new BooleanAlgebra.BinaryArray(imp4);
            Console.WriteLine(bin4.ToString());


            Assert.AreNotEqual(bin1.ToString(), bin2.ToString());
            Assert.AreEqual(bin1.ToString(), bin3.ToString());
            Assert.IsFalse(bin1.Equals(bin4));
            Assert.IsTrue(bin1.Equals(bin3));
            //System.Console.WriteLine(bin1.valueAt(5)); // should crash
        }