Beispiel #1
0
        public void UpdateOperation_HappyPathTest()
        {
            CalculatorOrchestrator calculatorOrchestrator = new CalculatorOrchestrator();
            TextBox textbox = null;
            Thread  t       = new Thread(() =>
            {
                textbox = new TextBox();
                calculatorOrchestrator.input = "10";
                calculatorOrchestrator.UpdateOperation(textbox, Operator.Add);
                Assert.AreEqual("", textbox.Text);
            });

            t.SetApartmentState(ApartmentState.STA);
            t.Start();
            t.Join();
        }
Beispiel #2
0
        public void ComputeResultDivide_HappyPathTest()
        {
            CalculatorOrchestrator calculatorOrchestrator = new CalculatorOrchestrator();
            TextBox textbox = null;
            Thread  t       = new Thread(() =>
            {
                textbox = new TextBox();
                calculatorOrchestrator.UpdateNumberToSystem(textbox, "10");
                calculatorOrchestrator.UpdateOperation(textbox, Operator.Divide);
                calculatorOrchestrator.UpdateNumberToSystem(textbox, "2");

                calculatorOrchestrator.ComputeResult(textbox);
                Assert.AreEqual("5", textbox.Text);
            });

            t.SetApartmentState(ApartmentState.STA);
            t.Start();
            t.Join();
        }