Exemplo n.º 1
0
 protected override void OnLoadExecute()
 {
     try
     {
         GenerateReportCommand.Execute();
     }
     catch (Exception)
     {
     }
 }
        public void ReportOptions_should_return_set_value()
        {
            var testController        = MockRepository.GenerateStub <ITestController>();
            var reportController      = MockRepository.GenerateStub <IReportController>();
            var reportOptions         = new ReportOptions("", "");
            var generateReportCommand = new GenerateReportCommand(testController, reportController)
            {
                ReportOptions = reportOptions
            };

            Assert.AreEqual(reportOptions, generateReportCommand.ReportOptions);
        }
        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));
        }