Exemplo n.º 1
0
        public static bool OperarorPlus_PositiveTests()
        {
            Polynom first   = new Polynom(25, 89, -54, 0, 3, 17);
            Polynom second  = new Polynom(42, 17, 22);
            Polynom plusRes = new Polynom(67, 106, -32, 0, 3, 17);

            int[] check = new int[plusRes.Length()];
            for (int i = 0; i < plusRes.Length(); i++)
            {
                check[i] = plusRes.Coefficents[i];
            }
            Polynom third = first + second;

            int[] check2 = new int[third.Length()];
            for (int i = 0; i < third.Length(); i++)
            {
                check2[i] = third.Coefficents[i];
            }
            IStructuralEquatable a = check;

            return(a.Equals(check2, StructuralComparisons.StructuralEqualityComparer));
        }
Exemplo n.º 2
0
        public static bool OperarorMultiply_PositiveTests()
        {
            Polynom first       = new Polynom(25, 89, -54, 0, 3, 17);
            Polynom second      = new Polynom(42, 17, 22);
            Polynom multiplyRes = new Polynom(1050, 4163, -205, 1040, -1062, 765, 355, 374);

            int[] check = new int[multiplyRes.Length()];
            for (int i = 0; i < multiplyRes.Length(); i++)
            {
                check[i] = multiplyRes.Coefficents[i];
            }
            Polynom third = first * second;

            int[] check2 = new int[third.Length()];
            for (int i = 0; i < third.Length(); i++)
            {
                check2[i] = third.Coefficents[i];
            }
            IStructuralEquatable a = check;

            return(a.Equals(check2, StructuralComparisons.StructuralEqualityComparer));
        }