コード例 #1
0
        public void SuccessfullyCalculateHyperbolicArccosineOfPositiveAngle()
        {
            var value    = 60;
            var function = new HyperbolicArccosineFunction();

            var phase = function.Calculate();

            Assert.NotNull(phase);
            Assert.Equal("Specify Argument", phase.Name);
            Assert.Equal("Specify angle to find the hyperbolic arccosine of.", phase.Description);
            Assert.Collection(phase.Inputs,
                              i =>
            {
                Assert.Equal("Angle", i.Info.Name);
                Assert.Null(i.Info.Description);
                Assert.Equal(new RadianUnit(), i.Info.Unit);
            });

            phase.Inputs[0].Value = value;

            Assert.Null(function.Calculate(phase));

            Assert.Collection(function.CurrentResult,
                              i =>
            {
                Assert.Equal(typeof(double), i.ValueType);
                Assert.Equal(Math.Acosh(value), TypeConverter.ToObject <double>(i.Value));
            });
        }
コード例 #2
0
        public void SuccessfullySetFunctionInfo()
        {
            var function = new HyperbolicArccosineFunction();

            Assert.NotNull(function.FunctionInfo);
            Assert.Equal("Hyperbolic Arccosine", function.FunctionInfo.Name);
            Assert.Equal(new Version("1.0.0"), function.FunctionInfo.Version);
            Assert.Equal("Find the hyperbolic arccosine of an angle.", function.FunctionInfo.Description);
            Assert.Collection(function.FunctionInfo.Tags,
                              i => Assert.Equal("hyperbolic", i),
                              i => Assert.Equal("arccosine", i),
                              i => Assert.Equal("arccosh", i));
        }
コード例 #3
0
        public void SuccessfullyCalculateHyperbolicArccosineWithNoAngleSpecified()
        {
            var function = new HyperbolicArccosineFunction();

            var phase = function.Calculate();

            Assert.NotNull(phase);

            Assert.Null(function.Calculate(phase));

            Assert.Collection(function.CurrentResult,
                              i =>
            {
                Assert.Equal(typeof(double), function.CurrentResult[0].ValueType);
                Assert.Equal(Math.Acosh(0.0), TypeConverter.ToObject <double>(function.CurrentResult[0].Value));
            });
        }
コード例 #4
0
        public void SuccessfullyCalculateHyperbolicArccosineOfNegativeAngle()
        {
            var value    = -54;
            var function = new HyperbolicArccosineFunction();

            var phase = function.Calculate();

            Assert.NotNull(phase);

            phase.Inputs[0].Value = value;

            Assert.Null(function.Calculate(phase));

            Assert.Collection(function.CurrentResult,
                              i =>
            {
                Assert.Equal(typeof(double), i.ValueType);
                Assert.Equal(Math.Acosh(value), TypeConverter.ToObject <double>(i.Value));
            });
        }