public void Facade_DesignPatternTest()
        {
            //Arrange
            double a = 5;
            double b = 5;
            double c = 144;
            double d = 12;
            double result1, result2, result3, result4, result5, result6, test1, test2;

            //Act
            ICalculatorComponent calculator = new Calculator();

            String  userInput = "addition";
            Invoker invoker   = new Invoker(userInput);

            invoker.Addition.Execute(invoker, calculator);
            calculator.TempOperations["Addition"].CreateCalculation(calculator, a, b);
            calculator.UserOperations.Add("+");
            calculator.CalculatorState.Add(new Context(new Unmodified()));
            result1 = calculator.TempOperations["Addition"].GetResult(calculator);

            userInput = "subtraction";
            invoker   = new Invoker(userInput);
            invoker.Subtraction.Execute(invoker, calculator);
            calculator.TempOperations["Subtraction"].CreateCalculation(calculator, a, b);
            calculator.UserOperations.Add("-");
            calculator.CalculatorState.Add(new Context(new Unmodified()));
            result2 = calculator.TempOperations["Subtraction"].GetResult(calculator);

            userInput = "multiplication";
            invoker   = new Invoker(userInput);
            invoker.Multiplication.Execute(invoker, calculator);
            calculator.TempOperations["Multiplication"].CreateCalculation(calculator, a, b);
            calculator.UserOperations.Add("*");
            calculator.CalculatorState.Add(new Context(new Unmodified()));
            result3 = calculator.TempOperations["Multiplication"].GetResult(calculator);

            userInput = "division";
            invoker   = new Invoker(userInput);
            invoker.Division.Execute(invoker, calculator);
            calculator.TempOperations["Division"].CreateCalculation(calculator, a, b);
            calculator.UserOperations.Add("/");
            calculator.CalculatorState.Add(new Context(new Unmodified()));
            result4 = calculator.TempOperations["Division"].GetResult(calculator);

            userInput = "square root";
            invoker   = new Invoker(userInput);
            invoker.SquareRoot.Execute(invoker, calculator);
            calculator.TempOperations["Square Root"].CreateCalculation(calculator, c);
            calculator.UserOperations.Add("SQUARE ROOT OF");
            calculator.CalculatorState.Add(new Context(new Unmodified()));
            result5 = calculator.TempOperations["Square Root"].GetResult(calculator);

            userInput = "square";
            invoker   = new Invoker(userInput);
            invoker.Square.Execute(invoker, calculator);
            calculator.TempOperations["Square"].CreateCalculation(calculator, d);
            calculator.UserOperations.Add("SQUARE OF");
            calculator.CalculatorState.Add(new Context(new Unmodified()));
            result6 = calculator.TempOperations["Square"].GetResult(calculator);

            Collection collection = new Collection();

            foreach (Calculation _calculation in calculator.CalculationHistory)
            {
                collection.CalculationHistory.Add(_calculation);
            }

            Iterator.Iterator iterator = collection.CreateIterator();

            iterator.First(calculator);

            // Facade will test for modified and removed calculations.
            CalculationManipulation manipulator    = new CalculationManipulation();
            Calculation             oldCalculation = iterator.CurrentCalculation(calculator);
            Calculation             newCalculation = manipulator._edit.TwoVariables(oldCalculation, 99, 1, "addition");

            iterator.SetTwoVariableCalculation(calculator, newCalculation, "+");

            test1 = iterator.CurrentCalculation(calculator).Operation(iterator.CurrentCalculation(calculator).A,
                                                                      iterator.CurrentCalculation(calculator).B);

            iterator.Next(calculator);
            manipulator.RemoveCalculation(calculator, iterator.GetIndex());

            test2 = calculator.CalculationHistory.Count();


            //Assert
            Assert.AreEqual(100, test1);
            Assert.AreEqual(6, test2);
        }
        public static void Activate(ICalculatorComponent calculator, String userInput)
        {
            Collection collection = new Collection();

            foreach (Calculation _calculation in calculator.CalculationHistory)
            {
                collection.CalculationHistory.Add(_calculation);
            }

            Iterator.Iterator iterator = collection.CreateIterator();


            // | 1 | View Calculation History (Format: Entire List)
            while (userInput.Equals("1"))
            {
                Prompts.ShowHistory();
                iterator.ShowAll(calculator);
                Prompts.Back();
                String enter = Console.ReadLine();
                userInput = "pass";
            }

            // | 2 | View Calculation History (Format: One By One)
            while (userInput.Equals("2"))
            {
                String enter = "";

                Prompts.IteratorTitle();
                iterator.First(calculator);

                while (enter != "EXIT")
                {
                    Prompts.IteratorOptions();
                    enter = Console.ReadLine();

                    while (enter.Equals("NEXT"))
                    {
                        iterator.Next(calculator);
                        enter = "pass";
                    }

                    while (enter.Equals("PREVIOUS"))
                    {
                        iterator.Previous(calculator);
                        enter = "pass";
                    }

                    while (enter.Equals("FIRST"))
                    {
                        iterator.First(calculator);
                        enter = "pass";
                    }

                    while (enter.Equals("LAST"))
                    {
                        iterator.Last(calculator);
                        enter = "pass";
                    }

                    while (enter.Equals("CHANGE"))
                    {
                        Prompts.ShowEdit();
                        Receiver.DisplayOperations(calculator, "");
                        string operation = Console.ReadLine();

                        CalculationManipulation manipulator    = new CalculationManipulation();
                        Calculation             oldCalculation = iterator.CurrentCalculation(calculator);
                        manipulator.EditCalculation(operation, oldCalculation, calculator, iterator);

                        iterator.Current(calculator);
                        WriteToConsole.Write("");

                        Prompts.Changed();
                        string temp = Console.ReadLine();
                        enter = "EXIT";
                    }

                    while (enter.Equals("REMOVE"))
                    {
                        CalculationManipulation manipulator = new CalculationManipulation();
                        manipulator.RemoveCalculation(calculator, iterator.GetIndex());
                        enter = "pass";
                        Prompts.Removed();
                        string temp = Console.ReadLine();
                        enter = "EXIT";
                    }

                    while ((!enter.Equals("NEXT")) && (!enter.Equals("PREVIOUS")) && (!enter.Equals("FIRST")) && (!enter.Equals("LAST") && (!enter.Equals("CHANGE") && (!enter.Equals("REMOVE")) && (!enter.Equals("pass")) && (!enter.Equals("EXIT")))))
                    {
                        Prompts.Enter();
                        string temp = Console.ReadLine();
                        enter = "pass";
                    }
                }

                userInput = "pass";
            }

            // | 5 | Check State Of All Calculations
            while (userInput.Equals("5"))
            {
                Prompts.StateTitle();
                iterator.ShowState(calculator);
                Prompts.StateOptions();
                String enter = Console.ReadLine();
                userInput = "pass";
            }
        }