Пример #1
0
        public void mixedSequence()
        {
            double[] testInput = new double[] { -3, -2, -1, 0, 1, 2, 3 };
            double   output    = Median.BruteForceMedian(testInput);
            double   expected  = 0;

            Assert.AreEqual(expected, output);
        }
Пример #2
0
        public void sequenceDescending()
        {
            double[] testInput = new double[] { 5, 4, 3, 2, 1 };
            double   output    = Median.BruteForceMedian(testInput);
            double   expected  = 3;

            Assert.AreEqual(expected, output);
        }
Пример #3
0
        public void negativeSequence()
        {
            double[] testInput = new double[] { -1, -2, -3, -4, -5 };
            double   output    = Median.BruteForceMedian(testInput);
            double   expected  = -3;

            Assert.AreEqual(expected, output);
        }
Пример #4
0
        public void singleSequence()
        {
            double[] testInput = new double[] { 1 };
            double   output    = Median.BruteForceMedian(testInput);
            double   expected  = 1;

            Assert.AreEqual(expected, output);
        }
Пример #5
0
        public void evenSequence()
        {
            double[] testInput = new double[] { 1, 2, 3, 4, 5, 6 };
            double   output    = Median.BruteForceMedian(testInput);
            double   expected  = 3;

            Assert.AreEqual(expected, output);
        }
Пример #6
0
        public void randomMedian()
        {
            double[] testInput = new double[] { -4, 2, 3, -2, 5, -1, 0, 4, 1, -3 };
            double   output    = Median.BruteForceMedian(testInput);
            double   expected  = 0;

            Assert.AreEqual(expected, output);
        }
Пример #7
0
        public void backLoaded()
        {
            double[] testInput = new double[] { 1, 1, 1, 1, 5 };
            double   output    = Median.BruteForceMedian(testInput);
            double   expected  = 1;

            Assert.AreEqual(expected, output);
        }
Пример #8
0
        public void endMedian()
        {
            double[] testInput = new double[] { 1, 2, 4, 5, 3 };
            double   output    = Median.BruteForceMedian(testInput);
            double   expected  = 3;

            Assert.AreEqual(expected, output);
        }
Пример #9
0
        public void noneGreater()
        {
            double[] testInput = new double[] { 1, 1, 2, 2, 2 };
            double   output    = Median.BruteForceMedian(testInput);
            double   expected  = 2;

            Assert.AreEqual(expected, output);
        }
Пример #10
0
        public void homogenous()
        {
            double[] testInput = new double[] { 3, 3, 3, 3, 3 };
            double   output    = Median.BruteForceMedian(testInput);
            double   expected  = 3;

            Assert.AreEqual(expected, output);
        }
Пример #11
0
        public void floatSequence()
        {
            double[] testInput = new double[] { 0.1, 0.2, 0.3, 0.4, 0.5 };
            double   output    = Median.BruteForceMedian(testInput);
            double   expected  = 0.3;

            Assert.AreEqual(expected, output);
        }
Пример #12
0
 public void emptySequence()
 {
     double[] testInput = new double[] { };
     double   output    = Median.BruteForceMedian(testInput);
 }