public void WaveFilter_Returns5And10_WhenPassed3And10()
        {
            var input = new int[] { 3, 10 };

            var output         = WaveFilters.FilterWaves(input);
            var expectedOutput = new int[] { 5, 10 };

            Assert.AreEqual(expectedOutput, output);
        }
        public void WaveFilter_Returns20And10And5_WhenPassed35And10And2()
        {
            var input = new int[] { 35, 10, 2 };

            var output         = WaveFilters.FilterWaves(input);
            var expectedOutput = new int[] { 20, 10, 5 };

            Assert.AreEqual(expectedOutput, output);
        }
        public void WaveFilter_Returns20_WhenPassed25()
        {
            int[] input = { 25 };

            var output         = WaveFilters.FilterWaves(input);
            var expectedOutput = new int[] { 20 };

            Assert.AreEqual(expectedOutput, output);
        }
Пример #4
0
        static void Main(string[] args)
        {
            int number = 0;

            int[] inputArray = new int[number];
            Console.WriteLine("Enter size of index array:");
            if (int.TryParse(Console.ReadLine(), out number))
            {
                for (int i = 0; i < number; i++)
                {
                    Console.WriteLine("Enter a number for {0}. number, {1} remaining:", i.ToString(), (number - (i)).ToString());
                    int indexNumber = 0;
                    if (int.TryParse(Console.ReadLine(), out indexNumber))
                    {
                        inputArray[i] = indexNumber;
                    }
                }
                Console.WriteLine("---------");
            }

            WaveFilters.FilterWaves(inputArray);
        }