Created
March 31, 2015 06:56
-
-
Save johnmmoss/92d79a681ba8f38e8d2b to your computer and use it in GitHub Desktop.
Entity Framework Mock DbContext
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ITimesheetsContext _context = MockRepository.GenerateStub<ITimesheetsContext>(); | |
_context.Departments = new TestDbSet<Department>(); | |
_context.Timesheets = new TestDbSet<Timesheet>(); | |
_context.Employees = new TestDbSet<Employee>(); | |
_context.Stub(c => c.SaveChangesAsync()).Return(Task.FromResult(0)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment