Esempio n. 1
0
 /// <summary>
 /// the event handler for the button sorts
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void SortingClick(object sender, EventArgs e)
 {
     try
     {
         var nameButton    = ((Button)sender).Name;
         var calculate     = FactorySort.CreatCalculator(nameButton);
         var firstArgument = FirstValue.Text;
         Result.Text = IntToStr(calculate.Sort(StrToInt(firstArgument)));
     }
     catch (Exception exc)
     {
         MessageBox.Show(exc.Message);
     }
 }
Esempio n. 2
0
        public void OneArgumentTest(string name, Type type)
        {
            var calculator = FactorySort.CreatCalculator(name);

            Assert.AreEqual(type, calculator.GetType());
        }