Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC-Unit test - ViewEngines

Hey, I'm working with mvc I have to write unit test for function that contains

var result = ViewEngines.Engines.FindPartialView(context, partialPath);    

and my test fails on this part : "The RouteData must contain an item named 'controller' with a non-empty string value."How can I make face object for this? thx

like image 219
Cipiripi Avatar asked Aug 16 '26 01:08

Cipiripi


1 Answers

add that for controller

 var routeData = new RouteData();
 routeData.Values.Add("controller", "someName");
 routeData.Values.Add("action", "someAction");
like image 200
evgen Avatar answered Aug 18 '26 03:08

evgen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!