public void Init() { var db = new FakeDataSource(); var testRecords = ObjectMother.ReturnPhotoDataRecord(3); testRecords.ForEach( r => db.Photos.Add(r)); db.SaveChanges(); target = new PhotosController(db, provider); target.context = new FakeHttpContext(); }
public void Init() { var fileName = @"..\..\TestFiles\Run For The Next Generation 2011 001.JPG"; fakeDataSource = new FakeDataSource(); target = new PhotosController(fakeDataSource, provider); target.ControllerContext = new FakeControllerContext(); target.ControllerContext.Request = SetupContent(fileName); target.context = new FakeHttpContext(); }
public void Init() { fakeDataSource = new FakeDataSource(); var photoRecordList = ObjectMother.ReturnPhotoDataRecord(3); foreach (var photo in photoRecordList) { fakeDataSource.Photos.Add(photo); } fakeDataSource.SaveChanges(); target = new PhotosController(fakeDataSource, provider); }