asp.net mvc - Mocking RouteTable.Routes.GetVirtualPath in MVC -
I have a paging controller with a method that calls
routing tab. RouteGetVirtualPath (I'm joking RequestContext, but I'm unsure what methods / qualities need to be stubed. I To correctly move the mockRequestContext virtualpath to a non-functional The path should be returned, and if so, does the stub need to work for it?
The advice was greatly appreciated.
Not sure that I understand the question, but Something looks like this:
Irrelevant MargTableMock = Rhinomox. CreteMock & lt; IRouteTable & gt; (); // Assume that IRouteTable.Routes type is IRoutes IRoutes path = Rhinomox. CreteMock & lt ; IRoutes & gt; (); // Rewind routes with counterfeit route TableMock.Stub (x = & gt; x.Routes). Return (route); // Setup GetVirtualPath for duplicate routes.Stub (x = & Gt; X.GetVirtualPath (Arg & lt; RequestContext & gt; .Is.Anything, Arg & lt; IDictionary & gt; Anything.) Reeturn (/ * Anyone who is /);
If you do not want this, you will have to tell more about your classes and what you want to test.
Comments
Post a Comment