You do not need a database connection to populate the DataSet. You can mock this as follows:
IDataInterface di = new Mock<IDataInterface>(); DataSet mockDataSet = CreateMockDataSet(); di.Expect(x => x.Get()).Returns(mockDataSet); something.UseDataInterface(di.Object);
Filling a dummy DataSet is pretty painful. If I do this, I usually put the facade interface in front of the returned DataSet, which is easier to make fun of. Or I change the code to use a DataTable, which is easier to populate.
Alternatively, use a built-in database such as SQLite or SQL Server CE to test the device.
Roger Lipscombe
source share