Wednesday 15 May 2013

c# - Mocking HttpActionContext.ActionArguments when testing Web.Api ActionFilter -


I am writing an OnActionExecuting Action Filter and I want to test the efficiency of the unit.

Filters need to filter to perform some assumptions on passed arguments.

I'm getting the argument from the actionContext.ActionArguments dictionary which is working fine implementation, but I have a hard time managing it for unit testing.

In my trial I can not set the actionContext.ActionArguments because there is no setter in it nor can I duplicate it. It is not virtual.

Was it left in some scandal, whether I could get any value from unit tests in this situation? According to the AspNetWebStack source code, actionContext.ActionArguments is just a simple dictionary. Therefore, I'm very slight to add a significant value to it. I just do something like this

actionContext.ActionArguments [key] = Value;

In the unit test part.

Hopefully

1 comment:

  1. Giuseppe: C - Mocking Httpactioncontext.Actionarguments When Testing Web.Api
    Actionfilter - >>>>> Download Now

    >>>>> Download Full

    Giuseppe: C - Mocking Httpactioncontext.Actionarguments When Testing Web.Api
    Actionfilter - >>>>> Download LINK

    >>>>> Download Now

    Giuseppe: C - Mocking Httpactioncontext.Actionarguments When Testing Web.Api
    Actionfilter - >>>>> Download Full

    >>>>> Download LINK LJ

    ReplyDelete