public void SetUp() { plugin = new GrassCoverErosionInwardsPlugin(); info = plugin.GetViewInfos().First(tni => tni.ViewType == typeof(GrassCoverErosionInwardsFailureMechanismResultView)); }
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 GrassCoverErosionInwardsPlugin { Gui = gui }) { // Call ViewInfo[] viewInfos = plugin.GetViewInfos().ToArray(); // Assert Assert.AreEqual(9, viewInfos.Length); PluginTestHelper.AssertViewInfoDefined( viewInfos, typeof(CalculationsStateFailureMechanismContext), typeof(CalculationsStateFailureMechanismView)); PluginTestHelper.AssertViewInfoDefined( viewInfos, typeof(RegistrationStateFailureMechanismContext), typeof(RegistrationStateFailureMechanismView)); PluginTestHelper.AssertViewInfoDefined( viewInfos, typeof(GrassCoverErosionInwardsScenariosContext), typeof(CalculationGroup), typeof(GrassCoverErosionInwardsScenariosView)); PluginTestHelper.AssertViewInfoDefined( viewInfos, typeof(GrassCoverErosionInwardsFailureMechanismSectionResultContext), typeof(IObservableEnumerable <AdoptableWithProfileProbabilityFailureMechanismSectionResult>), typeof(GrassCoverErosionInwardsFailureMechanismResultView)); PluginTestHelper.AssertViewInfoDefined( viewInfos, typeof(GrassCoverErosionInwardsInputContext), typeof(GrassCoverErosionInwardsCalculation), typeof(GrassCoverErosionInwardsInputView)); PluginTestHelper.AssertViewInfoDefined( viewInfos, typeof(DikeHeightOutputContext), typeof(GrassCoverErosionInwardsCalculation), typeof(DikeHeightOutputGeneralResultFaultTreeIllustrationPointView)); PluginTestHelper.AssertViewInfoDefined( viewInfos, typeof(OvertoppingOutputContext), typeof(GrassCoverErosionInwardsCalculation), typeof(OvertoppingOutputGeneralResultFaultTreeIllustrationPointView)); PluginTestHelper.AssertViewInfoDefined( viewInfos, typeof(OvertoppingRateOutputContext), typeof(GrassCoverErosionInwardsCalculation), typeof(OvertoppingRateOutputGeneralResultFaultTreeIllustrationPointView)); PluginTestHelper.AssertViewInfoDefined( viewInfos, typeof(GrassCoverErosionInwardsCalculationGroupContext), typeof(CalculationGroup), typeof(GrassCoverErosionInwardsCalculationsView)); viewInfos.ForEachElementDo(vi => { Assert.AreEqual(symbol, vi.GetSymbol()); Assert.AreSame(fontFamily, vi.GetFontFamily()); }); } mockRepository.VerifyAll(); }
public void SetUp() { mocks = new MockRepository(); plugin = new GrassCoverErosionInwardsPlugin(); info = plugin.GetViewInfos().First(tni => tni.ViewType == typeof(GrassCoverErosionInwardsFailureMechanismView)); }
public void SetUp() { plugin = new GrassCoverErosionInwardsPlugin(); info = plugin.GetViewInfos().First(tni => tni.ViewType == typeof(TView)); }