Algorithmix.UnitTest.UtilitiesTest.ThresholdTest C# (CSharp) Method

ThresholdTest() private method

private ThresholdTest ( ) : void
return void
        public void ThresholdTest()
        {
            Console.WriteLine("Threshold Testing Begin...");
            var input = new double[] {0, 40, 100, 60, 80, 90, 10, 70, 59, 100};
            var expected = new double[] {0, 0, 100, 100, 100, 100, 0, 100, 0, 100};
            var actual = Utility.Threshold(input, 0.6);

            Assert.IsTrue(expected.Length == actual.Length);
            for (int ii = 0; ii < input.Length; ii++)
            {
                Assert.IsTrue(Math.Abs(expected[ii] - actual[ii]) < 0.001);
            }
            Console.WriteLine("Threshold Successful");
        }