Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
        public void AddTest(string name, Type type)
        {
            ISingleCalculator calculate = SingleFactory.CreateCalculator(name);

            Assert.IsInstanceOf(type, calculate);
        }