private void OneCalculate(object sender, EventArgs e) { try { string firstValue = textBox1.Text; double first = Convert.ToDouble(firstValue); ISingleCalculator calculate = SingleFactory.CreateCalculator(((Button)sender).Name); var third = calculate.Calculate(first); Rez.Text = third.ToString(); } catch (Exception ex) { MessageBox.Show("произошла ошибка: " + ex.Message); } }
public void AddTest(string name, Type type) { ISingleCalculator calculate = SingleFactory.CreateCalculator(name); Assert.IsInstanceOf(type, calculate); }