Data Transformation

The first step is to build a stub to isolate the Web service implementation from the data access code. We need a stub class because we want to hide how the RecordingDataSet is retrieved. The stub will return a RecordingDataSet that is built inmemory as opposed to one retrieved from the database. Here is the first test:

public class CatalogServiceStubFixture { private RecordingDataSet.Recording recording; private RecordingDataSet.Recording actual; private CatalogServiceStub service; [SetUp] public void SetUp() { recording = CreateRecording(); service = new CatalogServiceStub(recording); actual = service.FindByRecordingId(recording.Id); } private RecordingDataSet.Recording CreateRecording() { RecordingDataSet dataSet = new RecordingDataSet(); ...

Get Test-Driven Development in Microsoft® .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.