public void CreateFileExporter_Always_ReturnFileExporter() { // Setup var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike) { HydraulicBoundaryDatabase = { Locations = { new HydraulicBoundaryLocation(1, "test", 0, 0) } } }; var context = new HydraulicBoundaryDatabaseContext(assessmentSection.HydraulicBoundaryDatabase, assessmentSection); const string filePath = "test"; using (var plugin = new RiskeerPlugin()) { ExportInfo info = GetExportInfo(plugin); // Call IFileExporter fileExporter = info.CreateFileExporter(context, filePath); // Assert Assert.IsInstanceOf <HydraulicBoundaryLocationCalculationsExporter>(fileExporter); } }
public void GivenCalculationsWithIllustrationPoints_WhenClearIllustrationPointsClickedAndDoNotContinue_ThenInquiryAndIllustrationPointsNotCleared( Func <IAssessmentSection, HydraulicBoundaryLocationCalculation> getHydraulicLocationCalculationFunc) { // Given var random = new Random(21); AssessmentSection assessmentSection = GetAssessmentSectionWithHydraulicBoundaryLocationCalculationOutputs(); HydraulicBoundaryLocationCalculation calculation = getHydraulicLocationCalculationFunc(assessmentSection); calculation.Output = new TestHydraulicBoundaryLocationCalculationOutput(random.NextDouble(), new TestGeneralResultSubMechanismIllustrationPoint()); HydraulicBoundaryLocationCalculation[] calculationsWithOutput = GetAllHydraulicLocationCalculationsWithOutput(assessmentSection).ToArray(); var messageBoxText = ""; DialogBoxHandler = (name, wnd) => { var helper = new MessageBoxTester(wnd); messageBoxText = helper.Text; helper.ClickCancel(); }; var context = new HydraulicBoundaryDatabaseContext(assessmentSection.HydraulicBoundaryDatabase, assessmentSection); var mockRepository = new MockRepository(); using (var treeViewControl = new TreeViewControl()) { var affectedCalculationObserver = mockRepository.StrictMock <IObserver>(); IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(cmp => cmp.MainWindow).Return(mockRepository.Stub <IMainWindow>()); gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); mockRepository.ReplayAll(); calculation.Attach(affectedCalculationObserver); using (var plugin = new RiskeerPlugin()) { TreeNodeInfo info = GetInfo(plugin); plugin.Gui = gui; using (ContextMenuStrip contextMenuAdapter = info.ContextMenuStrip(context, null, treeViewControl)) { // When contextMenuAdapter.Items[contextMenuClearIllustrationPointsIndex].PerformClick(); // Then const string expectedMessage = "Weet u zeker dat u alle berekende illustratiepunten bij 'Hydraulische belastingen' wilt wissen?"; Assert.AreEqual(expectedMessage, messageBoxText); Assert.IsTrue(calculationsWithOutput.All(calc => calc.HasOutput)); Assert.IsTrue(calculation.Output.HasGeneralResult); } } } mockRepository.VerifyAll(); }
public void ContextMenuStrip_Always_AddImportItem() { // Setup var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); var context = new HydraulicBoundaryDatabaseContext(assessmentSection.HydraulicBoundaryDatabase, assessmentSection); var applicationFeatureCommands = mocks.Stub <IApplicationFeatureCommands>(); var importCommandHandler = mocks.Stub <IImportCommandHandler>(); importCommandHandler.Stub(ich => ich.GetSupportedImportInfos(null)).IgnoreArguments().Return(new[] { new ImportInfo() }); var exportCommandHandler = mocks.Stub <IExportCommandHandler>(); var updateCommandHandler = mocks.Stub <IUpdateCommandHandler>(); var viewCommands = mocks.Stub <IViewCommands>(); using (var treeViewControl = new TreeViewControl()) { var builder = new ContextMenuBuilder(applicationFeatureCommands, importCommandHandler, exportCommandHandler, updateCommandHandler, viewCommands, context, treeViewControl); IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(g => g.Get(context, treeViewControl)).Return(builder); gui.Stub(cmp => cmp.MainWindow).Return(mocks.Stub <IMainWindow>()); mocks.ReplayAll(); using (var plugin = new RiskeerPlugin()) { TreeNodeInfo info = GetInfo(plugin); plugin.Gui = gui; // Call using (ContextMenuStrip contextMenu = info.ContextMenuStrip(context, assessmentSection, treeViewControl)) { TestHelper.AssertContextMenuStripContainsItem(contextMenu, contextMenuImportHydraulicBoundaryDatabaseIndex, "&Koppel aan database...", "Koppel aan hydraulische belastingendatabase.", RiskeerCommonFormsResources.DatabaseIcon); } } } // Assert mocks.VerifyAll(); }
public void Constructor_ExpectedValues() { // Setup var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); // Call var context = new HydraulicBoundaryDatabaseContext(assessmentSection.HydraulicBoundaryDatabase, assessmentSection); // Assert Assert.IsInstanceOf <ObservableWrappedObjectContextBase <HydraulicBoundaryDatabase> >(context); Assert.AreSame(assessmentSection.HydraulicBoundaryDatabase, context.WrappedData); Assert.AreSame(assessmentSection, context.AssessmentSection); }
public void ContextMenuStrip_HydraulicBoundaryLocationCalculationsWithIllustrationPoints_ContextMenuItemClearAllIllustrationPointsEnabledAndTooltipSet( Func <IAssessmentSection, HydraulicBoundaryLocationCalculation> getHydraulicBoundaryLocationCalculationFunc) { // Setup var random = new Random(21); var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); SetHydraulicBoundaryLocationCalculationsForUserDefinedTargetProbabilities(assessmentSection); assessmentSection.SetHydraulicBoundaryLocationCalculations(new[] { new TestHydraulicBoundaryLocation() }); HydraulicBoundaryLocationCalculation calculation = getHydraulicBoundaryLocationCalculationFunc(assessmentSection); calculation.Output = new TestHydraulicBoundaryLocationCalculationOutput(random.NextDouble(), new TestGeneralResultSubMechanismIllustrationPoint()); var nodeData = new HydraulicBoundaryDatabaseContext(assessmentSection.HydraulicBoundaryDatabase, assessmentSection); var mockRepository = new MockRepository(); using (var treeViewControl = new TreeViewControl()) { IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); gui.Stub(cmp => cmp.MainWindow).Return(mockRepository.Stub <IMainWindow>()); mockRepository.ReplayAll(); using (var plugin = new RiskeerPlugin()) { TreeNodeInfo info = GetInfo(plugin); plugin.Gui = gui; // Call using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // Assert ToolStripItem contextMenuItem = contextMenu.Items[contextMenuClearIllustrationPointsIndex]; Assert.AreEqual("Wis alle illustratiepunten...", contextMenuItem.Text); Assert.AreEqual("Wis alle berekende illustratiepunten.", contextMenuItem.ToolTipText); TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.ClearIllustrationPointsIcon, contextMenuItem.Image); Assert.IsTrue(contextMenuItem.Enabled); } } } mockRepository.VerifyAll(); // Expect no calls on arguments }
public void ContextMenuStrip_HydraulicBoundaryDatabaseLinkedToInvalidFile_ContextMenuItemCalculateAllDisabledAndTooltipSet() { // Setup var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike) { HydraulicBoundaryDatabase = { FilePath = "invalidFilePath" } }; var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation("locationName"); assessmentSection.SetHydraulicBoundaryLocationCalculations(new[] { hydraulicBoundaryLocation }); var nodeData = new HydraulicBoundaryDatabaseContext(assessmentSection.HydraulicBoundaryDatabase, assessmentSection); using (var treeViewControl = new TreeViewControl()) { IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(cmp => cmp.MainWindow).Return(mocks.Stub <IMainWindow>()); gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); mocks.ReplayAll(); using (var plugin = new RiskeerPlugin()) { TreeNodeInfo info = GetInfo(plugin); plugin.Gui = gui; // Call using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // Assert ToolStripItem contextMenuItem = contextMenu.Items[contextMenuCalculateAllIndex]; Assert.AreEqual("Alles be&rekenen", contextMenuItem.Text); StringAssert.Contains("Herstellen van de verbinding met de hydraulische belastingendatabase is mislukt.", contextMenuItem.ToolTipText); TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.CalculateAllIcon, contextMenuItem.Image); Assert.IsFalse(contextMenuItem.Enabled); } } } mocks.VerifyAll(); // Expect no calls on arguments }
public void IsEnabled_HydraulicBoundaryDatabaseNotLinked_ReturnFalse() { // Setup var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); var context = new HydraulicBoundaryDatabaseContext(assessmentSection.HydraulicBoundaryDatabase, assessmentSection); using (var plugin = new RiskeerPlugin()) { ExportInfo info = GetExportInfo(plugin); // Call bool isEnabled = info.IsEnabled(context); // Assert Assert.IsFalse(isEnabled); } }
public void ContextMenuStrip_Always_CallsContextMenuBuilderMethods() { // Setup var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); var context = new HydraulicBoundaryDatabaseContext(assessmentSection.HydraulicBoundaryDatabase, assessmentSection); var menuBuilder = mocks.StrictMock <IContextMenuBuilder>(); using (mocks.Ordered()) { menuBuilder.Expect(mb => mb.AddImportItem(null, null, null)).IgnoreArguments().Return(menuBuilder); menuBuilder.Expect(mb => mb.AddExportItem()).Return(menuBuilder); menuBuilder.Expect(mb => mb.AddSeparator()).Return(menuBuilder); menuBuilder.Expect(mb => mb.AddCustomItem(null)).IgnoreArguments().Return(menuBuilder); menuBuilder.Expect(mb => mb.AddSeparator()).Return(menuBuilder); menuBuilder.Expect(mb => mb.AddCustomItem(null)).IgnoreArguments().Return(menuBuilder); menuBuilder.Expect(mb => mb.AddSeparator()).Return(menuBuilder); menuBuilder.Expect(mb => mb.AddCollapseAllItem()).Return(menuBuilder); menuBuilder.Expect(mb => mb.AddExpandAllItem()).Return(menuBuilder); menuBuilder.Expect(mb => mb.AddSeparator()).Return(menuBuilder); menuBuilder.Expect(mb => mb.AddPropertiesItem()).Return(menuBuilder); menuBuilder.Expect(mb => mb.Build()).Return(null); } using (var treeViewControl = new TreeViewControl()) { IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(menuBuilder); gui.Stub(cmp => cmp.MainWindow).Return(mocks.Stub <IMainWindow>()); mocks.ReplayAll(); using (var plugin = new RiskeerPlugin()) { TreeNodeInfo info = GetInfo(plugin); plugin.Gui = gui; // Call info.ContextMenuStrip(context, null, treeViewControl); } } // Assert mocks.VerifyAll(); }
public void ChildNodeObjects_HydraulicBoundaryDatabaseNotLinked_ReturnsEmpty() { // Setup var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); var hydraulicBoundaryDatabaseContext = new HydraulicBoundaryDatabaseContext(assessmentSection.HydraulicBoundaryDatabase, assessmentSection); using (var plugin = new RiskeerPlugin()) { TreeNodeInfo info = GetInfo(plugin); // Call object[] objects = info.ChildNodeObjects(hydraulicBoundaryDatabaseContext).ToArray(); // Assert Assert.AreEqual(0, objects.Length); } }
public void ForeColor_HydraulicBoundaryDatabaseNotLinked_ReturnDisabledColor() { // Setup var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); var hydraulicBoundaryDatabaseContext = new HydraulicBoundaryDatabaseContext(assessmentSection.HydraulicBoundaryDatabase, assessmentSection); using (var plugin = new RiskeerPlugin()) { TreeNodeInfo info = GetInfo(plugin); // Call Color color = info.ForeColor(hydraulicBoundaryDatabaseContext); // Assert Assert.AreEqual(Color.FromKnownColor(KnownColor.GrayText), color); } }
public void CreateFileImporter_Always_ReturnFileImporter() { // Setup mocks = new MockRepository(); var gui = mocks.Stub <IGui>(); gui.Stub(g => g.ViewCommands).Return(mocks.Stub <IViewCommands>()); gui.Stub(g => g.ProjectOpened += null).IgnoreArguments(); gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments(); mocks.ReplayAll(); var importTarget = new HydraulicBoundaryDatabaseContext(new HydraulicBoundaryDatabase(), new AssessmentSection(AssessmentSectionComposition.Dike)); // Call IFileImporter importer = importInfo.CreateFileImporter(importTarget, ""); // Assert Assert.IsInstanceOf <HydraulicBoundaryDatabaseImporter>(importer); mocks.VerifyAll(); }
public void Text_Always_ReturnsSetName() { // Setup const string name = "Hydraulische belastingen"; var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); var context = new HydraulicBoundaryDatabaseContext(assessmentSection.HydraulicBoundaryDatabase, assessmentSection); using (var plugin = new RiskeerPlugin()) { TreeNodeInfo info = GetInfo(plugin); // Call string text = info.Text(context); // Assert Assert.AreEqual(name, text); } }
public void CreateInstance_WithContext_ReturnHydraulicBoundaryDatabaseProperties() { // Setup var mocks = new MockRepository(); var mainWindow = mocks.Stub <IMainWindow>(); IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(g => g.MainWindow).Return(mainWindow); mocks.ReplayAll(); plugin.Gui = gui; var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); var context = new HydraulicBoundaryDatabaseContext(assessmentSection.HydraulicBoundaryDatabase, assessmentSection); // Call IObjectProperties objectProperties = info.CreateInstance(context); // Assert Assert.IsInstanceOf <HydraulicBoundaryDatabaseProperties>(objectProperties); Assert.AreSame(context.WrappedData, objectProperties.Data); }
public void ContextMenuStrip_HydraulicBoundaryLocationCalculationsWithoutIllustrationPoints_ContextMenuItemClearAllIllustrationPointsDisabled() { // Setup var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); assessmentSection.SetHydraulicBoundaryLocationCalculations(new[] { new TestHydraulicBoundaryLocation() }); var nodeData = new HydraulicBoundaryDatabaseContext(assessmentSection.HydraulicBoundaryDatabase, assessmentSection); var mockRepository = new MockRepository(); using (var treeViewControl = new TreeViewControl()) { IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); gui.Stub(cmp => cmp.MainWindow).Return(mockRepository.Stub <IMainWindow>()); mockRepository.ReplayAll(); using (var plugin = new RiskeerPlugin()) { TreeNodeInfo info = GetInfo(plugin); plugin.Gui = gui; // Call using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { // Assert ToolStripItem contextMenuItem = contextMenu.Items[contextMenuClearIllustrationPointsIndex]; Assert.IsFalse(contextMenuItem.Enabled); } } } mockRepository.VerifyAll(); // Expect no calls on arguments }
public void ChildNodeObjects_HydraulicBoundaryDatabaseLinked_ReturnsChildrenOfData() { // Setup var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike) { HydraulicBoundaryDatabase = { FilePath = "databaseFile" } }; var hydraulicBoundaryDatabaseContext = new HydraulicBoundaryDatabaseContext(assessmentSection.HydraulicBoundaryDatabase, assessmentSection); using (var plugin = new RiskeerPlugin()) { TreeNodeInfo info = GetInfo(plugin); // Call object[] objects = info.ChildNodeObjects(hydraulicBoundaryDatabaseContext).ToArray(); // Assert Assert.AreEqual(3, objects.Length); var waterLevelCalculationsForNormTargetProbabilitiesGroupContext = (WaterLevelCalculationsForNormTargetProbabilitiesGroupContext)objects[0]; Assert.AreSame(assessmentSection.HydraulicBoundaryDatabase.Locations, waterLevelCalculationsForNormTargetProbabilitiesGroupContext.WrappedData); Assert.AreSame(assessmentSection, waterLevelCalculationsForNormTargetProbabilitiesGroupContext.AssessmentSection); var waterLevelCalculationsForUserDefinedTargetProbabilitiesGroupContext = (WaterLevelCalculationsForUserDefinedTargetProbabilitiesGroupContext)objects[1]; Assert.AreSame(assessmentSection.WaterLevelCalculationsForUserDefinedTargetProbabilities, waterLevelCalculationsForUserDefinedTargetProbabilitiesGroupContext.WrappedData); Assert.AreSame(assessmentSection, waterLevelCalculationsForUserDefinedTargetProbabilitiesGroupContext.AssessmentSection); var waveHeightCalculationsForUserDefinedTargetProbabilitiesGroupContext = (WaveHeightCalculationsForUserDefinedTargetProbabilitiesGroupContext)objects[2]; Assert.AreSame(assessmentSection.WaveHeightCalculationsForUserDefinedTargetProbabilities, waveHeightCalculationsForUserDefinedTargetProbabilitiesGroupContext.WrappedData); Assert.AreSame(assessmentSection, waveHeightCalculationsForUserDefinedTargetProbabilitiesGroupContext.AssessmentSection); } }
public void GivenValidCalculations_WhenCalculatingAllFromContextMenu_ThenAllCalculationsScheduled() { // Given string validFilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite"); var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike) { HydraulicBoundaryDatabase = { FilePath = validFilePath } }; HydraulicBoundaryDatabaseTestHelper.SetHydraulicBoundaryLocationConfigurationSettings(assessmentSection.HydraulicBoundaryDatabase); SetHydraulicBoundaryLocationCalculationsForUserDefinedTargetProbabilities(assessmentSection); var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation("locationName"); assessmentSection.SetHydraulicBoundaryLocationCalculations(new[] { hydraulicBoundaryLocation }); var context = new HydraulicBoundaryDatabaseContext(assessmentSection.HydraulicBoundaryDatabase, assessmentSection); using (var treeViewControl = new TreeViewControl()) using (var plugin = new RiskeerPlugin()) { IMainWindow mainWindow = MainWindowTestHelper.CreateMainWindowStub(mocks); IGui gui = StubFactory.CreateGuiStub(mocks); gui.Stub(g => g.MainWindow).Return(mainWindow); gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); gui.Stub(g => g.DocumentViewController).Return(mocks.Stub <IDocumentViewController>()); gui.Stub(g => g.ViewCommands).Return(mocks.Stub <IViewCommands>()); gui.Stub(g => g.ProjectStore).Return(mocks.Stub <IStoreProject>()); var calculatorFactory = mocks.Stub <IHydraRingCalculatorFactory>(); var designWaterLevelCalculator = new TestDesignWaterLevelCalculator { Converged = false }; var waveHeightCalculator = new TestWaveHeightCalculator { Converged = false }; HydraulicBoundaryCalculationSettings expectedSettings = HydraulicBoundaryCalculationSettingsFactory.CreateSettings(assessmentSection.HydraulicBoundaryDatabase); calculatorFactory.Expect(cf => cf.CreateDesignWaterLevelCalculator(Arg <HydraRingCalculationSettings> .Is.NotNull)) .WhenCalled(invocation => { HydraRingCalculationSettingsTestHelper.AssertHydraRingCalculationSettings( expectedSettings, (HydraRingCalculationSettings)invocation.Arguments[0]); }) .Return(designWaterLevelCalculator) .Repeat .Times(4); calculatorFactory.Expect(cf => cf.CreateWaveHeightCalculator(Arg <HydraRingCalculationSettings> .Is.NotNull)) .WhenCalled(invocation => { HydraRingCalculationSettingsTestHelper.AssertHydraRingCalculationSettings( expectedSettings, (HydraRingCalculationSettings)invocation.Arguments[0]); }).Return(waveHeightCalculator) .Repeat .Times(2); mocks.ReplayAll(); TreeNodeInfo info = GetInfo(plugin); plugin.Gui = gui; plugin.Activate(); DialogBoxHandler = (name, wnd) => { // Expect an activity dialog which is automatically closed }; using (ContextMenuStrip contextMenuAdapter = info.ContextMenuStrip(context, null, treeViewControl)) using (new HydraRingCalculatorFactoryConfig(calculatorFactory)) { // When void Call() => contextMenuAdapter.Items[contextMenuCalculateAllIndex].PerformClick(); // Then TestHelper.AssertLogMessages(Call, messages => { string[] msgs = messages.ToArray(); Assert.AreEqual(48, msgs.Length); const string designWaterLevelCalculationTypeDisplayName = "Waterstand"; const string designWaterLevelCalculationDisplayName = "Waterstand berekening"; HydraulicBoundaryLocationCalculationActivityLogTestHelper.AssertHydraulicBoundaryLocationCalculationMessages( hydraulicBoundaryLocation.Name, designWaterLevelCalculationTypeDisplayName, designWaterLevelCalculationDisplayName, "1/30.000", msgs, 0); HydraulicBoundaryLocationCalculationActivityLogTestHelper.AssertHydraulicBoundaryLocationCalculationMessages( hydraulicBoundaryLocation.Name, designWaterLevelCalculationTypeDisplayName, designWaterLevelCalculationDisplayName, "1/30.000 (1)", msgs, 8); HydraulicBoundaryLocationCalculationActivityLogTestHelper.AssertHydraulicBoundaryLocationCalculationMessages( hydraulicBoundaryLocation.Name, designWaterLevelCalculationTypeDisplayName, designWaterLevelCalculationDisplayName, "1/10", msgs, 16); HydraulicBoundaryLocationCalculationActivityLogTestHelper.AssertHydraulicBoundaryLocationCalculationMessages( hydraulicBoundaryLocation.Name, designWaterLevelCalculationTypeDisplayName, designWaterLevelCalculationDisplayName, "1/100", msgs, 24); const string waveHeightCalculationTypeDisplayName = "Golfhoogte"; const string waveHeightCalculationDisplayName = "Golfhoogte berekening"; HydraulicBoundaryLocationCalculationActivityLogTestHelper.AssertHydraulicBoundaryLocationCalculationMessages( hydraulicBoundaryLocation.Name, waveHeightCalculationTypeDisplayName, waveHeightCalculationDisplayName, "1/40", msgs, 32); HydraulicBoundaryLocationCalculationActivityLogTestHelper.AssertHydraulicBoundaryLocationCalculationMessages( hydraulicBoundaryLocation.Name, waveHeightCalculationTypeDisplayName, waveHeightCalculationDisplayName, "1/400", msgs, 40); }); } } mocks.VerifyAll(); }