示例#1
0
        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);
        }
示例#2
0
        public void FactoryTest(string name, Type type)
        {
            IOneCalculation calc = OneCalculation.CreateCalculator(name);

            Assert.IsInstanceOf(type, calc);
        }