The best way to do it is to set your expecatation on the repository itself that is inovked by LINQ querieis. For example i am doing a save operation on northwind data context and i want it to happen without ever the cal going to its underlying database:
var saved =
var mockDataContext = Mock.Create<NorthwindDataContextDataContext>();
Mock.Arrange(() => mockDataContext.SubmitChanges()).DoInstead(() =>
var product =
ProductID = 1,
UnitsInStock = 3,
voa_class = 1
ProductRepository repository =
Assert.IsTrue(mockDataContext.GetChangeSet().Inserts.Count == 1);
Here, optionally i am asserting the insert count that is set to the number of items that is set during SubmitChanges() call.
This is kind of basic start, but you can use this same concept for getting data and and performing various operation on top of it.
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.