public void CloseViewForData_ForNonMatchingFailureMechanism_ReturnsFalse()
        {
            // Setup
            using (var plugin = new DuneErosionPlugin())
                using (var view = new DuneLocationCalculationsView(new ObservableList <DuneLocationCalculation>(),
                                                                   new DuneErosionFailureMechanism(),
                                                                   new AssessmentSectionStub(),
                                                                   () => 0.01,
                                                                   () => "1/100"))
                {
                    ViewInfo info = GetInfo(plugin);

                    // Call
                    bool closeForData = info.CloseForData(view, new DuneErosionFailureMechanism());

                    // Assert
                    Assert.IsFalse(closeForData);
                }
        }
        public void AfterCreate_Always_SetsExpectedProperties()
        {
            // Setup
            var mocks             = new MockRepository();
            var assessmentSection = mocks.Stub <IAssessmentSection>();
            var window            = mocks.Stub <IMainWindow>();
            var gui = mocks.Stub <IGui>();

            gui.Stub(g => g.MainWindow).Return(window);
            gui.Stub(g => g.ViewHost).Return(mocks.Stub <IViewHost>());
            mocks.ReplayAll();

            var failureMechanism = new DuneErosionFailureMechanism();
            var data             = new DuneLocationCalculationsForUserDefinedTargetProbabilityContext(new DuneLocationCalculationsForTargetProbability(0.1),
                                                                                                      failureMechanism,
                                                                                                      assessmentSection);

            using (var plugin = new DuneErosionPlugin())
            {
                ViewInfo info = GetInfo(plugin);

                plugin.Gui = gui;
                plugin.Activate();

                using (var view = new DuneLocationCalculationsView(new ObservableList <DuneLocationCalculation>(),
                                                                   failureMechanism,
                                                                   assessmentSection,
                                                                   () => 0.01,
                                                                   () => "1/100"))
                {
                    // Call
                    info.AfterCreate(view, data);

                    // Assert
                    Assert.IsInstanceOf <DuneLocationCalculationGuiService>(view.CalculationGuiService);
                }
            }

            mocks.VerifyAll();
        }