You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 19, 2024. It is now read-only.
I'm trying to write a fluent test that will test the parameter values passed to the action. Below is the code I used and am not getting the results I expected. In the route I am adding overrideImageFormat to the defaults object, but it is not being used by the test. The code below but inside a VS project can be found here: https://www.dropbox.com/s/ao4ksxw6xwsqxxp/MvcRouteTesterIssue.zip?dl=0
public class ImageTestController : Controller
{
public ActionResult Icon(IconTestModel model, ImageFormat overrideImageFormat = null)
{
return Content("");
}
}
public class IconTestModel
{
public string Name { get; set; }
public string OverlayName { get; set; }
}
[TestMethod]
public void Test()
{
var routes = new RouteCollection();
var route = routes.MapRoute(
name: "Icon", url: "Icon/{name}",
defaults: new
{
controller = "ImageTest", action = "Icon",
overrideImageFormat = ImageFormat.Png,
}
);
route.DataTokens["area"] = "Common";
routes
.ShouldMap("/icon/name")
.To<ImageTestController>(ctrl => ctrl.Icon(new IconTestModel { Name = "name" }, ImageFormat.Png));
}
I'm trying to write a fluent test that will test the parameter values passed to the action. Below is the code I used and am not getting the results I expected. In the route I am adding overrideImageFormat to the defaults object, but it is not being used by the test. The code below but inside a VS project can be found here: https://www.dropbox.com/s/ao4ksxw6xwsqxxp/MvcRouteTesterIssue.zip?dl=0