コード例 #1
0
        public void ExecuteComplexNumberTest()
        {
            var complex = new Complex(3, 2);
            var exp     = new Arccos(new ComplexNumber(complex));
            var result  = (Complex)exp.Execute();

            Assert.Equal(Complex.Acos(complex), result);
            Assert.Equal(0.60613782238729386, result.Real, 15);
            Assert.Equal(-1.9686379257930964, result.Imaginary, 15);
        }
コード例 #2
0
        public void ExecuteTestException()
        {
            var exp = new Arccos(new Bool(false));

            Assert.Throws <ResultIsNotSupportedException>(() => exp.Execute());
        }
コード例 #3
0
        public void ExecuteGradianTest()
        {
            var exp = new Arccos(new Number(1));

            Assert.Equal(Math.Acos(1) / Math.PI * 200, exp.Execute(AngleMeasurement.Gradian));
        }
コード例 #4
0
        public void ExecuteDegreeTest()
        {
            var exp = new Arccos(new Number(1));

            Assert.Equal(Math.Acos(1) / Math.PI * 180, exp.Execute(AngleMeasurement.Degree));
        }