Beispiel #1
0
 public void SetUp()
 {
     using (var plugin = new MacroStabilityInwardsPlugin())
     {
         info = plugin.GetViewInfos().First(tni => tni.ViewType == typeof(FailureMechanismSectionsProbabilityAssessmentView));
     }
 }
 protected override bool ShouldCloseMethod(IView view, object o)
 {
     using (var plugin = new MacroStabilityInwardsPlugin())
     {
         return(plugin.GetViewInfos()
                .First(tni => tni.ViewType == typeof(MacroStabilityInwardsOutputView))
                .CloseForData(view, o));
     }
 }
Beispiel #3
0
 public void SetUp()
 {
     mocks  = new MockRepository();
     plugin = new MacroStabilityInwardsPlugin();
     info   = plugin.GetViewInfos().First(tni => tni.ViewType == typeof(MacroStabilityInwardsFailureMechanismResultView));
 }
Beispiel #4
0
 public void SetUp()
 {
     plugin = new MacroStabilityInwardsPlugin();
     info   = plugin.GetViewInfos().First(tni => tni.ViewType == typeof(MacroStabilityInwardsCalculationsView));
 }
Beispiel #5
0
        public void GetViewInfos_ReturnsSupportedViewInfos()
        {
            // Setup
            const string symbol     = "<symbol>";
            var          fontFamily = new FontFamily();

            var mockRepository = new MockRepository();
            var gui            = mockRepository.Stub <IGui>();

            gui.Stub(g => g.ActiveStateInfo).Return(new StateInfo(string.Empty, symbol, fontFamily, p => p));
            mockRepository.ReplayAll();

            using (var plugin = new MacroStabilityInwardsPlugin
            {
                Gui = gui
            })
            {
                // Call
                ViewInfo[] viewInfos = plugin.GetViewInfos().ToArray();

                // Assert
                Assert.AreEqual(8, viewInfos.Length);

                PluginTestHelper.AssertViewInfoDefined(
                    viewInfos,
                    typeof(CalculationsStateFailureMechanismContext),
                    typeof(CalculationsStateFailureMechanismView));

                PluginTestHelper.AssertViewInfoDefined(
                    viewInfos,
                    typeof(RegistrationStateFailureMechanismContext),
                    typeof(RegistrationStateFailureMechanismView));

                PluginTestHelper.AssertViewInfoDefined(
                    viewInfos,
                    typeof(MacroStabilityInwardsFailureMechanismSectionResultContext),
                    typeof(IObservableEnumerable <AdoptableWithProfileProbabilityFailureMechanismSectionResult>),
                    typeof(MacroStabilityInwardsFailureMechanismResultView));

                PluginTestHelper.AssertViewInfoDefined(
                    viewInfos,
                    typeof(MacroStabilityInwardsCalculationGroupContext),
                    typeof(CalculationGroup),
                    typeof(MacroStabilityInwardsCalculationsView));

                PluginTestHelper.AssertViewInfoDefined(
                    viewInfos,
                    typeof(MacroStabilityInwardsInputContext),
                    typeof(MacroStabilityInwardsCalculationScenario),
                    typeof(MacroStabilityInwardsInputView));

                PluginTestHelper.AssertViewInfoDefined(
                    viewInfos,
                    typeof(MacroStabilityInwardsScenariosContext),
                    typeof(CalculationGroup),
                    typeof(MacroStabilityInwardsScenariosView));

                PluginTestHelper.AssertViewInfoDefined(
                    viewInfos,
                    typeof(MacroStabilityInwardsOutputContext),
                    typeof(MacroStabilityInwardsCalculationScenario),
                    typeof(MacroStabilityInwardsOutputView));

                PluginTestHelper.AssertViewInfoDefined(
                    viewInfos,
                    typeof(MacroStabilityInwardsFailureMechanismSectionsContext),
                    typeof(IEnumerable <FailureMechanismSection>),
                    typeof(FailureMechanismSectionsProbabilityAssessmentView));

                viewInfos.ForEachElementDo(vi =>
                {
                    Assert.AreEqual(symbol, vi.GetSymbol());
                    Assert.AreSame(fontFamily, vi.GetFontFamily());
                });
            }

            mockRepository.VerifyAll();
        }