public void Blur() { var imageSource = MockRepository.GenerateMock<IImageSource>(); imageSource.Expect(o => o.GetImage(null)) .IgnoreArguments() .Return(new Image(new Blob(File.ReadAllBytes(@"..\..\taj_orig.jpg")))); var controller = new ImageController(imageSource); controller.SetupMockContext(); controller.SetupQueryString(new NameValueCollection()); using (var ms = new MemoryStream()) { controller.SetupOutputStream(ms); controller.HandleUnknownAction("blur"); var fileName = "test.jpg"; File.WriteAllBytes(fileName, ms.ToArray()); Process.Start(fileName); } }
public void Index() { // Setup var imageSource = MockRepository.GenerateMock<IImageSource>(); var controller = new ImageController(imageSource); }