Mocking a Repository - Part 2

2 posts, 0 answers
  1. James
    James avatar
    4 posts
    Member since:
    Jul 2010

    Posted 10 Jun 2011 Link to this post

    In regards to http://www.telerik.com/community/forums/reply-thread.aspx?messageId=1680620&threadId=303674 I'm hoping that someone might be able to provide further help on this?

    This example was great. I'm wondering if someone there could point me in a direction on how to do "NorthwindDataContextDataContext"? I did some research and see that I might be creating this with sqlMetal.exe. If so, would you mine letting me know

    1) what command line you used to generate it?
    2) how do you add it to the project? I was able to generate a "cs" file containing many LINQ objects but could not seem to be able to reference the class once I created it?
    3) when I was doing my research, I believe that I might have come across a refernce to be able to generate store procedure (could be wrong as it was late last night when I was running it @ home and now it is early in the office here) :). If this is the case, can I add records to JustMock and run the store procedure against it?

    Thanks for a great product. Everytime I go back to do further research on mocking objects, the more that I seem such a hugh benefit in using it :)

    Thanks again,

    James
  2. Ricky
    Admin
    Ricky avatar
    467 posts

    Posted 13 Jun 2011 Link to this post

    Hi James,

    Thanks again for reaching us. In general, if you have NorthWind database configured the next steps should be easy. You can create a .edmx from the visual studio wizard that will have the NorthwindDataContext ready for you.

    There is a similar example done with openaccess but is the same in case of entity framework
    http://weblogs.asp.net/mehfuzh/archive/2010/07/29/mocking-linq-to-sql-continued-using-rlinq.aspx

    On your question:
    3) when I was doing my research, I believe that I might have come across a refernce to be able to generate store procedure (could be wrong as it was late last night when I was running it @ home and now it is early in the office here) :). If this is the case, can I add records to JustMock and run the store procedure against it?

    => Here you will be mocking the context class to isolate the data layer, therefore it really don’t depends on the procedures you use.

    KInd Regards,
    Ricky
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft R3 2016 release webinar banner
Back to Top