Example #1
0
        public bool test_Equal_True(out string message)
        {
            message = "";
            DataLeaf a = new DataLeaf(typeof(int));
            DataLeaf b = new DataLeaf(typeof(int));

            a.Value = 874;
            b.Value = 874;
            if (!a.Equal(b))
            {
                message = "wrong result of Equal - value '" + a.Value.ToString() + "' vs '" + b.Value.ToString() + "'";
                return(false);
            }

            a = new DataLeaf(typeof(int[]));
            b = new DataLeaf(typeof(int[]));
            int [] array = new int[] { 874, 123 };
            a.Value = array;
            b.Value = array;
            if (!a.Equal(b))
            {
                message = "wrong result of Equal - reference";
                return(false);
            }

            return(true);
        }
Example #2
0
        public bool test_Equal_False(out string message)
        {
            message = "";
            DataLeaf a = new DataLeaf(typeof(int));
            DataLeaf b = new DataLeaf(typeof(int));

            a.Value = 874;
            b.Value = 144;
            if (a.Equal(b))
            {
                message = "wrong result of Equal - value";
                return(false);
            }

            a       = new DataLeaf(typeof(int[]));
            b       = new DataLeaf(typeof(int[]));
            a.Value = new int[] { 123, 874 };
            b.Value = new int[] { 874, 123 };
            if (a.Equal(b))
            {
                message = "wrong result of Equal - diffrent references on diffrent values";
                return(false);
            }

            a       = new DataLeaf(typeof(int[]));
            b       = new DataLeaf(typeof(int[]));
            a.Value = new int[] { 874, 123 };
            b.Value = new int[] { 874, 123 };
            if (a.Equal(b))
            {
                message = "wrong result of Equal - diffrent references on same values";
                return(false);
            }

            return(true);
        }
Example #3
0
        public bool test_Equal_False(out string message)
        {
            message = "";
            DataLeaf a = new DataLeaf(typeof(int));
            DataLeaf b = new DataLeaf(typeof(int));
            a.Value = 874;
            b.Value = 144;
            if (a.Equal(b))
            {
                message = "wrong result of Equal - value";
                return false;
            }

            a = new DataLeaf(typeof(int[]));
            b = new DataLeaf(typeof(int[]));
            a.Value = new int[]{123, 874};
            b.Value = new int[]{874, 123};
            if (a.Equal(b))
            {
                message = "wrong result of Equal - diffrent references on diffrent values";
                return false;
            }

            a = new DataLeaf(typeof(int[]));
            b = new DataLeaf(typeof(int[]));
            a.Value = new int[]{874, 123};
            b.Value = new int[]{874, 123};
            if (a.Equal(b))
            {
                message = "wrong result of Equal - diffrent references on same values";
                return false;
            }

            return true;
        }
Example #4
0
        public bool test_Equal_True(out string message)
        {
            message = "";
            DataLeaf a = new DataLeaf(typeof(int));
            DataLeaf b = new DataLeaf(typeof(int));
            a.Value = 874;
            b.Value = 874;
            if (!a.Equal(b))
            {
                message = "wrong result of Equal - value '" + a.Value.ToString() + "' vs '" + b.Value.ToString()+"'";
                return false;
            }

            a = new DataLeaf(typeof(int[]));
            b = new DataLeaf(typeof(int[]));
            int [] array =  new int[]{874, 123};
            a.Value = array;
            b.Value = array;
            if (!a.Equal(b))
            {
                message = "wrong result of Equal - reference";
                return false;
            }

            return true;
        }