private void ClickOne(object sender, EventArgs e) { double first = Convert.ToDouble(textBox1.Text); string calculationName = ((Button)sender).Name; IOneCalculation calculator = OneCalculation.CreateCalculator(calculationName); double result = calculator.Calculate(first); label1.Text = Convert.ToString(result); }
public void FactoryTest(string name, Type type) { IOneCalculation calc = OneCalculation.CreateCalculator(name); Assert.IsInstanceOf(type, calc); }