public void SuccessfullyCalculateArccotangentOfPositiveAngle() { var value = 60; var function = new ArccotangentFunction(); var phase = function.Calculate(); Assert.NotNull(phase); Assert.Equal("Specify Argument", phase.Name); Assert.Equal("Specify angle to find the 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.Atan(value), TypeConverter.ToObject <double>(i.Value)); }); }
public void SuccessfullySetFunctionInfo() { var function = new ArccotangentFunction(); Assert.NotNull(function.FunctionInfo); Assert.Equal("Arccotangent", function.FunctionInfo.Name); Assert.Equal(new Version("1.0.0"), function.FunctionInfo.Version); Assert.Equal("Find the arccotangent of an angle.", function.FunctionInfo.Description); Assert.Collection(function.FunctionInfo.Tags, i => Assert.Equal("arccotangent", i), i => Assert.Equal("arccot", i)); }
public void SuccessfullyCalculateArccotangentWithNoAngleSpecified() { var function = new ArccotangentFunction(); 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.Atan(0.0), TypeConverter.ToObject <double>(function.CurrentResult[0].Value)); }); }
public void SuccessfullyCalculateArccotangentOfNegativeAngle() { var value = -54; var function = new ArccotangentFunction(); 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.Atan(value), TypeConverter.ToObject <double>(i.Value)); }); }