コード例 #1
0
        private void Process_Algorithm(object sender, RoutedEventArgs e)
        {
            // string output = "";

            if ((bool)bubble.IsChecked)
            {
                List <int> convertedInput = StringToIntList.Convert(input.Text);
                List <int> sortedList     = Bubble.Sort(convertedInput);

                result.Content = IntListToString.Convert(sortedList);
            }
            ;

            if ((bool)selection.IsChecked)
            {
                List <int> convertedInput = StringToIntList.Convert(input.Text);
                List <int> sortedList     = Selection.Sort(convertedInput);

                result.Content = IntListToString.Convert(sortedList);
            }

            if ((bool)fibonacci.IsChecked)
            {
                MessageBox.Show(fibonacci.Name);
            }
        }
コード例 #2
0
        public void StringToIntList_returnedTypeIsCollection()
        {
            // arrange
            string inputString = "1234";

            // act
            var actual = StringToIntList.Convert(inputString);

            // assert
            Assert.IsInstanceOfType(actual, typeof(List <int>));
        }
コード例 #3
0
        public void StringToIntList_inputString_returnCollection()
        {
            // arrange
            string     inputString = "1234";
            List <int> expected    = new List <int>()
            {
                1, 2, 3, 4
            };

            // act
            var actual = StringToIntList.Convert(inputString);

            // assert
            CollectionAssert.AreEqual(expected, actual);
        }