Ejemplo n.º 1
0
 protected override void OnLoadExecute()
 {
     try
     {
         GenerateReportCommand.Execute();
     }
     catch (Exception)
     {
     }
 }
        public void Execute_should_call_GenerateReport_on_ReportController()
        {
            var testController = MockRepository.GenerateStub <ITestController>();
            var report         = new Report();

            testController.Stub(tc => tc.ReadReport(null)).IgnoreArguments().Do(
                (Action <ReadAction <Report> >)(action => action(report)));
            var reportController      = MockRepository.GenerateStub <IReportController>();
            var reportOptions         = new ReportOptions("", "");
            var generateReportCommand = new GenerateReportCommand(testController, reportController)
            {
                ReportOptions = reportOptions
            };
            var progressMonitor = MockProgressMonitor.Instance;

            generateReportCommand.Execute(progressMonitor);

            reportController.AssertWasCalled(rc => rc.GenerateReport(report, reportOptions,
                                                                     progressMonitor));
        }