예제 #1
0
 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);
     }
 }
예제 #2
0
 public void Index()
 {
     // Setup
     var imageSource = MockRepository.GenerateMock<IImageSource>();
     var controller = new ImageController(imageSource);
 }