public async Task AddOrEditProduct_CorrectInput_ReturnsViewResult() { //Arrange ProductController controller = new ProductController(); ProductVM Input = new ProductVM() { Id = 5, UserId = 1, Name = "Iphone 7", Category = "Electronics", Code = "E1", Price = 120000, Description = "This product is value for money.", Status = "In Stock", Discount = 10000 }; //Correct Input string ExpectedAction = "Index"; string ExpectedController = "Product"; //Act var Result = await controller.AddOrEditProduct(Input) as RedirectToRouteResult; Result.RouteValues["action"].Equals("Index"); Result.RouteValues["controller"].Equals("Product"); //Assert Assert.AreEqual(ExpectedAction, Result.RouteValues["action"]); Assert.AreEqual(ExpectedController, Result.RouteValues["controller"]); }