public void TestGetString() { var test1 = new TComplex(3, 4); var resulr = test1.GetString(); Assert.AreEqual(resulr, "3 + i * 4"); }
public void GetDegree1() { TComplex testClass = new TComplex(3, 4); double answer = 53.1301; Assert.AreEqual(answer, testClass.GetDegree(), 4); }
public void TestDegree() { var test1 = new TComplex(3, 4); var resulr = test1.Degree(); Assert.AreEqual(53.1301, resulr, 4); }
public void TestRad() { var test1 = new TComplex(3, 4); var resulr = test1.Rad(); Assert.AreEqual(0.927295, resulr, 5); }
public void GetDegree2() { TComplex testClass = new TComplex(0, -3); double answer = -90; Assert.AreEqual(answer, testClass.GetDegree(), 4); }
public void GetRad1() { TComplex testClass = new TComplex(3, 4); double answer = 0.927295; Assert.AreEqual(answer, testClass.GetRad(), 4); }
public void TestAbs() { var test1 = new TComplex(3, 4); var resulr = test1.Abs(); Assert.AreEqual(resulr, 5); }
public void Abs1() { TComplex testClass = new TComplex(3, 4); double answer = 5; Assert.AreEqual(answer, testClass.Abs(), 4); }
public void Init6() { TComplex testClass = new TComplex(0, -22.22); string output = "0 + i * -22.22"; Assert.AreEqual(output, testClass.ToString()); }
public void TestTComplexDouble() { var testClass = new TComplex(55.89, 44.44); Assert.AreEqual(testClass.real, 55.89); Assert.AreEqual(testClass.imaginary, 44.44); }
public void Init4() { TComplex testClass = new TComplex(4.01, 6); string output = "4.01 + i * 6"; Assert.AreEqual(output, testClass.ToString()); }
public void Init5() { TComplex testClass = new TComplex(-3.02, 7); string output = "-3.02 + i * 7"; Assert.AreEqual(output, testClass.ToString()); }
public void Init2() { TComplex testClass = new TComplex(0, 0); string output = "0 + i * 0"; Assert.AreEqual(output, testClass.ToString()); }
public void Init3() { TComplex testClass = new TComplex(3, -2); string output = "3 + i * -2"; Assert.AreEqual(output, testClass.ToString()); }
public void GetRad2() { TComplex testClass = new TComplex(0, -3); double answer = -1.570796; Assert.AreEqual(answer, testClass.GetRad(), 4); }
public void Init1() { TComplex testClass = new TComplex(6, 3); string output = "6 + i * 3"; Assert.AreEqual(output, testClass.ToString()); }
public void Abs2() { TComplex testClass = new TComplex(0, -3); double answer = 3; Assert.AreEqual(answer, testClass.Abs(), 4); }
public void TestGetImaginaryNumber() { var test1 = new TComplex(3, 4); var resulr = test1.GetImaginaryNumber(); Assert.AreEqual(resulr, 4); }
public void TestGetRealNumber() { var test1 = new TComplex(3, 4); var resulr = test1.GetRealNumber(); Assert.AreEqual(resulr, 3); }
public void TestNeRavnTrue() { var test1 = new TComplex(3, 4); var resulr = test1.NeRavn(test1); Assert.IsFalse(resulr); }
public void TestRoot() { var test1 = new TComplex(3, 4); var resulr = test1.Sqrt(3, 4); Assert.AreEqual(resulr.real, 2.567133, 5); Assert.AreEqual(resulr.imaginary, 2.142468, 5); }
public void TestTComplexString() { string output = "7,5 + i * 3,1"; var testClass = new TComplex(output); Assert.AreEqual(testClass.real, 7.5); Assert.AreEqual(testClass.imaginary, 3.1); }
public void TestRavnFalse() { var test1 = new TComplex(3, 4); var test2 = new TComplex(4, -1); var resulr = test1.Ravn(test2); Assert.IsFalse(resulr); }
public void TestReverse() { var test1 = new TComplex(0, -3); var resulr = test1.Reverse(); Assert.AreEqual(resulr.real, 0); Assert.AreEqual(resulr.imaginary, 0.333333, 5); }
public void TestPow() { var test1 = new TComplex(3, 4); var resulr = test1.Pow(5); Assert.AreEqual(resulr.real, -237, 4); Assert.AreEqual(resulr.imaginary, -3116, 4); }
public void TestCopy() { var test1 = new TComplex(55.89, 44.44); var test2 = test1.Copy(); Assert.AreEqual(test1.real, test2.real); Assert.AreEqual(test1.imaginary, test2.imaginary); }
public void TestMinus() { var test1 = new TComplex(0, 4); var resulr = test1.Minus(); Assert.AreEqual(resulr.real, 0); Assert.AreEqual(resulr.imaginary, -4); }
public void TestSquare() { var test1 = new TComplex(3, 4); var resulr = test1.Square(); Assert.AreEqual(resulr.real, -7); Assert.AreEqual(resulr.imaginary, 24); }
public void Root2() { TComplex testClass = new TComplex(16, -2); testClass = testClass.Root(10, 4); string output = "-0.301 + i * 1.286"; Assert.AreEqual(output, testClass.ToString()); }
public void Root1() { TComplex testClass = new TComplex(3, 4); testClass = testClass.Root(5, 3); string output = "-0.353 + i * 1.334"; Assert.AreEqual(output, testClass.ToString()); }