public ActionResult Sum(int a, int b) { CalculatorModels model = new CalculatorModels() { a = a, b = b }; model.Sum(); return(View(model)); }
public void TestMethod7() { //Arrange CalculatorModels model = null; //Act ViewResult result = homeController.Index() as ViewResult; //Assert Assert.IsNotNull(result); }
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)); }
public void CreateController() { homeController = new HomeController(); calculatorModels = new CalculatorModels(); }