public void GetExportInfos_ReturnsSupportedExportInfos() { // 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 StabilityPointStructuresPlugin { Gui = gui }) { // Call ExportInfo[] exportInfos = plugin.GetExportInfos().ToArray(); // Assert Assert.AreEqual(2, exportInfos.Length); Assert.IsTrue(exportInfos.Any(tni => tni.DataType == typeof(StabilityPointStructuresCalculationGroupContext))); Assert.IsTrue(exportInfos.Any(tni => tni.DataType == typeof(StabilityPointStructuresCalculationScenarioContext))); } mocks.VerifyAll(); }
public void SetUp() { mocks = new MockRepository(); var mainWindow = mocks.Stub <IMainWindow>(); var gui = mocks.Stub <IGui>(); gui.Stub(g => g.MainWindow).Return(mainWindow); mocks.Replay(gui); mocks.Replay(mainWindow); plugin = new StabilityPointStructuresPlugin { Gui = gui }; info = plugin.GetExportInfos().First(ei => ei.DataType == typeof(StabilityPointStructuresCalculationScenarioContext)); }