I have a controller method that accepts a couple of input parameters (string, int, etc.). Because I don't want to declare each parameter in this method I created a class with properties that map to this parameters and now the only parameter to this method is an instance of this class. When the method is called, the object's properties are populated with the values of arguments according to their names.
Now I want to unit test this method; so I want to send a mock of this class to the method. At first I created a mock of the class and send it to the method; it worked fine except that I had to mark all properties that I want to set inside mock with the virtual keyword so mock framework can access it.
Because of that I thought that I could create an interface that this class implements, but it is not possible to send the interface as an argument to the controller method.
Is it somehow possible to manually bind input parameters to the properties of the object? For example, to inject interface via controller's constructor and then trigger some manual bind of the input values to the properties?
I am using ASP.NET MVC 3.