public MainWindowViewModel(ICalculatorFacade calculator)
 {
     this.calculator         = calculator;
     screenText              = "0";
     NumericButtonCommand    = createActionCommand((string a) => NumericButtonClicked(a));
     DotButtonCommand        = createActionCommand(() => calculator.dotButtonPressed());
     SignButtonCommand       = createActionCommand(() => calculator.invertSignButtonPressed());
     DivideButtonCommand     = createActionCommand(() => calculator.operatorButtonPressed(CalculatorOperator.DIVIDE));
     MultiplyButtonCommand   = createActionCommand(() => calculator.operatorButtonPressed(CalculatorOperator.MULTIPLY));
     SubtractButtonCommand   = createActionCommand(() => calculator.operatorButtonPressed(CalculatorOperator.SUBTRACT));
     AddButtonCommand        = createActionCommand(() => calculator.operatorButtonPressed(CalculatorOperator.ADD));
     CancelButtonCommand     = createActionCommand(() => calculator.clearButtonPressed());
     SquareRootButtonCommand = createActionCommand(() => calculator.squareRootButtonPressed());
     PercentButtonCommand    = createActionCommand(() => calculator.percentButtonPressed());
     EqualButtonCommand      = createActionCommand(() => calculator.equalButtonPressed());
 }
 public CalculatorController(ICalculatorFacade calcalatorFacade)
 {
     _calculatorFacade = calcalatorFacade;
 }
 public HomeController(ICalculatorFacade calculatorFacade)
 {
     _calculatorFacade = calculatorFacade;
 }
Ejemplo n.º 4
0
 public void setUpMocks()
 {
     mocks     = new MockRepository();
     calc      = (ICalculatorFacade)mocks.StrictMock(typeof(ICalculatorFacade));
     viewModel = new MainWindowViewModel(calc);
 }
 public CalculatorFacadeTests()
 {
     _calculatorService = new Mock <ICalculationService>();
     _calcalatorFacade  = new CalculatorFacade(_calculatorService.Object);
 }