示例#1
0
        public void TestSquare()
        {
            var test1  = new TComplex(3, 4);
            var resulr = test1.Square();

            Assert.AreEqual(resulr.real, -7);
            Assert.AreEqual(resulr.imaginary, 24);
        }
示例#2
0
        public void Square2()
        {
            TComplex testClass = new TComplex(0, -3);

            testClass = testClass.Square() as TComplex;
            string output = "-9 + i * 0";

            Assert.AreEqual(output, testClass.ToString());
        }
示例#3
0
        public void Square1()
        {
            TComplex testClass = new TComplex(3, 4);

            testClass = testClass.Square() as TComplex;
            string output = "-7 + i * 24";

            Assert.AreEqual(output, testClass.ToString());
        }