Exemplo n.º 1
0
        public void SuccessfullyCalculateHyperbolicArccotangentOfPositiveAngle()
        {
            var value    = 60;
            var function = new HyperbolicArccotangentFunction();

            var phase = function.Calculate();

            Assert.NotNull(phase);
            Assert.Equal("Specify Argument", phase.Name);
            Assert.Equal("Specify angle to find the hyperbolic arccotangent 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(1.0 / Math.Atanh(value), TypeConverter.ToObject <double>(i.Value));
            });
        }
Exemplo n.º 2
0
        public void SuccessfullyCalculateHyperbolicArccotangentWithNoAngleSpecified()
        {
            var function = new HyperbolicArccotangentFunction();

            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(1.0 / Math.Atanh(0.0), TypeConverter.ToObject <double>(function.CurrentResult[0].Value));
            });
        }
Exemplo n.º 3
0
        public void SuccessfullyCalculateHyperbolicArccotangentOfNegativeAngle()
        {
            var value    = -54;
            var function = new HyperbolicArccotangentFunction();

            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(1.0 / Math.Atanh(value), TypeConverter.ToObject <double>(i.Value));
            });
        }