Esempio n. 1
0
        /// <summary>
        /// Tell the calculator engine to clear itself
        /// </summary>
        private void clear_btn(object sender, EventArgs e)
        {
            if (sender is Button)
            {
                Button clearBtn = sender as Button;
                switch (clearBtn.Name)
                {
                case "clear_All":
                    CalcEngine.ClearAll();
                    paren_txt.Text     = string.Empty;
                    operation_txt.Text = string.Empty;
                    status_txt.Text    = string.Empty;
                    UpdateScreen();
                    break;

                case "clear_Entry":
                    CalcEngine.clear();
                    UpdateScreen();
                    if (!CalcEngine.m_openParen)
                    {
                        status_txt.Text = string.Empty;
                    }
                    break;
                }
            }
        }
 public void clearCalcEngine()
 {
     CalcEngine.ClearAll();
     Assert.IsTrue(CalcEngine.AssureCleared());
 }