public void GetUpdateInfos_ReturnsSupportedUpdateInfos() { // Setup var mocks = new MockRepository(); var mainWindow = mocks.Stub <IMainWindow>(); var gui = mocks.Stub <IGui>(); gui.Stub(g => g.MainWindow).Return(mainWindow); mocks.ReplayAll(); using (var plugin = new PipingPlugin { Gui = gui }) { // Call UpdateInfo[] updateInfos = plugin.GetUpdateInfos().ToArray(); // Assert Assert.AreEqual(3, updateInfos.Length); Assert.AreEqual(1, updateInfos.Count(updateInfo => updateInfo.DataType == typeof(PipingSurfaceLinesContext))); Assert.AreEqual(1, updateInfos.Count(updateInfo => updateInfo.DataType == typeof(PipingStochasticSoilModelCollectionContext))); Assert.AreEqual(1, updateInfos.Count(updateInfo => updateInfo.DataType == typeof(PipingFailureMechanismSectionsContext))); } mocks.VerifyAll(); }
private static UpdateInfo GetUpdateInfo(PipingPlugin plugin) { return(plugin.GetUpdateInfos().First(ui => ui.DataType == typeof(PipingFailureMechanismSectionsContext))); }
public override void Setup() { plugin = new PipingPlugin(); updateInfo = plugin.GetUpdateInfos().First(i => i.DataType == typeof(PipingSurfaceLinesContext)); }
public override void Setup() { plugin = new PipingPlugin(); updateInfo = plugin.GetUpdateInfos().First(i => i.DataType == typeof(PipingStochasticSoilModelCollectionContext)); }