Is there Parameters limitation in JustMock

2 posts, 0 answers
  1. qwer
    qwer avatar
    18 posts
    Member since:
    Oct 2010

    Posted 15 Jul 2011 Link to this post

    Hi There,
         Currently I've facing parameters limitation in JustMock,
    I've several functions which have more than 9 parameter, (eg: 10 parameters)

    When I'm mock my function, up to 9 parameter it is ok to compile, when my functions have 10 or more parameter JustMock give me error. as following
    Error    17    Delegate 'Telerik.JustMock.Action2' does not take 10 arguments   

    sample function
    //Try to Produce Error of more than 9 Parameters for JustMock
    void GetTestFunc(int param1, int param2, int param3, int param4, int param5,
    string sParam6, string sParam7, string sParam8, string sParam9, string sParam10)
    string _nothing= sParam10;
    //Inside Test Project 
            Mock.Arrange(()=> GetTestFunc(Arg.AnyInt, Arg.AnyInt,Arg.AnyInt, Arg.AnyInt,Arg.AnyInt, Arg.AnyString,Arg.AnyString,Arg.AnyString,Arg.AnyString,Arg.AnyString))
                    .DoInstead((int one, int two, int three, int four, int five, string a, string b, string c, string d, string e) =>
                            string _a = e;
  2. Ricky
    Ricky avatar
    467 posts

    Posted 20 Jul 2011 Link to this post

    Hi Qwer,

    Thanks again for reaching us. Here i am adding a task to support up to 16 arguments as like .net 4.0. Therefore, if you have arguments more than that then it’s great (best practice) to wrap them up in an object (POCO).

    In addition if you need the fix with 16 arguments urgently, please open up a support ticket (since i can’t send internal builds to public forum) so that i can send you the latest internal build as soon as possible.

    Kind regards,
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top