This is a migrated thread and some comments may be shown as answers.

Mocking a Repository - Part 2

1 Answer 93 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 10 Jun 2011, 07:31 PM
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

1 Answer, 1 is accepted

Sort by
0
Ricky
Telerik team
answered on 13 Jun 2011, 08:45 AM
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
Tags
General Discussions
Asked by
James
Top achievements
Rank 1
Answers by
Ricky
Telerik team
Share this question
or