Exemple #1
0
        public static bool IsAceEqual(GenericAce ace1, GenericAce ace2)
        {
            bool result = true;
            byte[] ace1BinaryForm;
            byte[] ace2BinaryForm;


            if (null != ace1 && null != ace2)
            {
                //check the BinaryLength
                if (ace1.BinaryLength != ace2.BinaryLength)
                {
                    result = false;
                }
                else
                {
                    ace1BinaryForm = new byte[ace1.BinaryLength];
                    ace2BinaryForm = new byte[ace2.BinaryLength];
                    ace1.GetBinaryForm(ace1BinaryForm, 0);
                    ace2.GetBinaryForm(ace2BinaryForm, 0);
                    if (!IsBinaryFormEqual(ace1BinaryForm, ace2BinaryForm))
                    {
                        result = false;
                    }
                }
            }
            else if (null == ace1 && null == ace2)
            {
                Console.WriteLine("Both aces are null");
            }
            else
                result = false;
            return result;
        }
        public static bool IsAceEqual(GenericAce ace1, GenericAce ace2)
        {
            bool result = true;

            byte[] ace1BinaryForm;
            byte[] ace2BinaryForm;


            if (null != ace1 && null != ace2)
            {
                //check the BinaryLength
                if (ace1.BinaryLength != ace2.BinaryLength)
                {
                    result = false;
                }
                else
                {
                    ace1BinaryForm = new byte[ace1.BinaryLength];
                    ace2BinaryForm = new byte[ace2.BinaryLength];
                    ace1.GetBinaryForm(ace1BinaryForm, 0);
                    ace2.GetBinaryForm(ace2BinaryForm, 0);
                    if (!IsBinaryFormEqual(ace1BinaryForm, ace2BinaryForm))
                    {
                        result = false;
                    }
                }
            }
            else if (null == ace1 && null == ace2)
            {
                Console.WriteLine("Both aces are null");
            }
            else
            {
                result = false;
            }
            return(result);
        }
 public void CustomAce_GetBinaryForm(GenericAce testAce, byte[] expectedBinaryForm, int testOffset)
 {
     byte[] resultBinaryForm = new byte[testAce.BinaryLength + testOffset];
     testAce.GetBinaryForm(resultBinaryForm, testOffset);
     GenericAce_VerifyBinaryForms(expectedBinaryForm, resultBinaryForm, testOffset);
 }
 public void ObjectAce_GetBinaryForm(GenericAce testAce, byte[] expectedBinaryForm, int testOffset)
 {
     byte[] resultBinaryForm = new byte[testAce.BinaryLength + testOffset];
     testAce.GetBinaryForm(resultBinaryForm, testOffset);
     GenericAce_VerifyBinaryForms(expectedBinaryForm, resultBinaryForm, testOffset);
 }