public void DataReaderInspector_ResultSetComposerShouldReceiveCalls() { IDataLoader dataLoader = new NorthwindLocalDataLoader(); ResultSetComposerMock composerMock = new ResultSetComposerMock(); EntityConnection inspectedFakeConnection = EntityConnectionHelper.CreateInspectedFakeEntityConnection( NorthwindObjectContext.DefaultConnectionString, composerMock, dataLoader); using (NorthwindObjectContext context = new NorthwindObjectContext(inspectedFakeConnection)) { // ToList() call enumerates the result set context.Categories.ToList(); } // The csv file contains 4 records Assert.AreEqual(8, composerMock.CommitCount); // Records has 4 fields Assert.AreEqual(8 * 4, composerMock.SetValueCount); }
public void DataReaderInspector_ResultSetComposerShouldReceiveCalls() { IDataLoader dataLoader = new NorthwindLocalDataLoader(); ResultSetComposerMock composerMock = new ResultSetComposerMock(); EntityConnection inspectedFakeConnection = EntityConnectionHelper.CreateInspectedFakeEntityConnection( NorthwindObjectContext.DefaultConnectionString, composerMock, dataLoader); using (NorthwindObjectContext context = new NorthwindObjectContext(inspectedFakeConnection)) { // ToList() call enumerates the result set context.Categories.ToList(); } // The csv file contains 4 records Assert.AreEqual(8, composerMock.CommitCount); // Records has 4 fields Assert.AreEqual(8 * 4, composerMock.SetValueCount); }