public void SetUp()
 {
     plugin = new HeightStructuresPlugin();
     info   = plugin.GetViewInfos().First(tni => tni.ViewType == typeof(HeightStructuresScenariosView));
 }
 public void SetUp()
 {
     plugin = new HeightStructuresPlugin();
     info   = plugin.GetViewInfos().First(tni => tni.ViewType == typeof(StructuresFailureMechanismResultView <HeightStructuresFailureMechanism, HeightStructuresInput>));
 }
Exemplo n.º 3
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();

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

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

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

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

                PluginTestHelper.AssertViewInfoDefined(
                    viewInfos,
                    typeof(HeightStructuresFailureMechanismSectionResultContext),
                    typeof(IObservableEnumerable <AdoptableFailureMechanismSectionResult>),
                    typeof(StructuresFailureMechanismResultView <HeightStructuresFailureMechanism, HeightStructuresInput>));

                PluginTestHelper.AssertViewInfoDefined(
                    viewInfos,
                    typeof(HeightStructuresScenariosContext),
                    typeof(CalculationGroup),
                    typeof(HeightStructuresScenariosView));

                PluginTestHelper.AssertViewInfoDefined(
                    viewInfos,
                    typeof(HeightStructuresCalculationGroupContext),
                    typeof(CalculationGroup),
                    typeof(HeightStructuresCalculationsView));

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

            mockRepository.VerifyAll();
        }
Exemplo n.º 4
0
 public void SetUp()
 {
     mocks  = new MockRepository();
     plugin = new HeightStructuresPlugin();
     info   = plugin.GetViewInfos().First(tni => tni.ViewType == typeof(HeightStructuresFailureMechanismView));
 }