Exemple #1
0
        public ActionResult Sum(int a, int b)
        {
            CalculatorModels model = new CalculatorModels()
            {
                a = a, b = b
            };

            model.Sum();
            return(View(model));
        }
Exemple #2
0
        public void TestMethod7()
        {
            //Arrange
            CalculatorModels model = null;

            //Act
            ViewResult result = homeController.Index() as ViewResult;

            //Assert
            Assert.IsNotNull(result);
        }
Exemple #3
0
 public ActionResult Index(CalculatorModels model, string command)
 {
     if (command == "add")
     {
         model.Result = model.A + model.B;
     }
     if (command == "sub")
     {
         model.Result = model.A - model.B;
     }
     if (command == "mul")
     {
         model.Result = model.A * model.B;
     }
     if (command == "div")
     {
         model.Result = model.A / model.B;
     }
     return(View(model));
 }
Exemple #4
0
 public void CreateController()
 {
     homeController   = new HomeController();
     calculatorModels = new CalculatorModels();
 }