/// <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); } }
public void OneArgumentTest(string name, Type type) { var calculator = FactorySort.CreatCalculator(name); Assert.AreEqual(type, calculator.GetType()); }