Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -r543721804bf58d098ee833d1a023a6e0018f1452 -r7c857a9d25bf11581d83514bda0d31413eca8dd3 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationContextTreeNodeInfoTest.cs (.../ClosingStructuresCalculationContextTreeNodeInfoTest.cs) (revision 543721804bf58d098ee833d1a023a6e0018f1452) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationContextTreeNodeInfoTest.cs (.../ClosingStructuresCalculationContextTreeNodeInfoTest.cs) (revision 7c857a9d25bf11581d83514bda0d31413eca8dd3) @@ -220,8 +220,6 @@ mocks.ReplayAll(); - plugin.Gui = gui; - // Call info.ContextMenuStrip(nodeData, null, treeViewControl); } @@ -253,8 +251,6 @@ mocks.ReplayAll(); - plugin.Gui = gui; - // Call using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, assessmentSection, treeViewControl)) { @@ -299,12 +295,9 @@ using (var treeViewControl = new TreeViewControl()) { - var gui = mocks.Stub(); gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(menuBuilder); mocks.ReplayAll(); - plugin.Gui = gui; - // Call using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, assessmentSection, treeViewControl)) { @@ -338,12 +331,9 @@ using (var treeViewControl = new TreeViewControl()) { - var gui = mocks.Stub(); gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(menuBuilder); mocks.ReplayAll(); - plugin.Gui = gui; - // Call using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, assessmentSection, treeViewControl)) { @@ -383,13 +373,10 @@ using (var treeViewControl = new TreeViewControl()) { var mainWindow = mocks.Stub(); - var gui = mocks.Stub(); gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); gui.Stub(g => g.MainWindow).Return(mainWindow); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, assessmentSection, treeViewControl)) { // When @@ -457,12 +444,10 @@ using (var treeViewControl = new TreeViewControl()) { var mainWindow = mocks.Stub(); - var gui = mocks.Stub(); gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); gui.Stub(g => g.MainWindow).Return(mainWindow); mocks.ReplayAll(); - plugin.Gui = gui; using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, assessmentSection, treeViewControl)) { // When @@ -534,13 +519,10 @@ using (var treeViewControl = new TreeViewControl()) { var mainWindow = mocks.Stub(); - var gui = mocks.Stub(); gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); gui.Stub(g => g.MainWindow).Return(mainWindow); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, assessmentSection, treeViewControl)) { // When @@ -599,13 +581,10 @@ using (var treeViewControl = new TreeViewControl()) { var mainWindow = mocks.Stub(); - var gui = mocks.Stub(); gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); gui.Stub(g => g.MainWindow).Return(mainWindow); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, assessmentSection, treeViewControl)) { // When @@ -665,13 +644,10 @@ using (var treeViewControl = new TreeViewControl()) { var mainWindow = mocks.Stub(); - var gui = mocks.Stub(); gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); gui.Stub(g => g.MainWindow).Return(mainWindow); mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, assessmentSection, treeViewControl)) { // When @@ -708,8 +684,6 @@ mocks.ReplayAll(); - plugin.Gui = gui; - // Call using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { @@ -746,8 +720,6 @@ mocks.ReplayAll(); - plugin.Gui = gui; - // Call using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { @@ -792,8 +764,6 @@ mocks.ReplayAll(); - plugin.Gui = gui; - // Call using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { @@ -836,8 +806,6 @@ mocks.ReplayAll(); - plugin.Gui = gui; - // Call using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) { @@ -901,8 +869,6 @@ mocks.ReplayAll(); - plugin.Gui = gui; - calculation.Attach(observer); DialogBoxHandler = (name, wnd) => @@ -921,12 +887,12 @@ { string[] msgs = messages.ToArray(); Assert.AreEqual(6, msgs.Length); - StringAssert.StartsWith(string.Format("Validatie van '{0}' gestart om: ", calculation.Name), msgs[0]); - StringAssert.StartsWith(string.Format("Validatie van '{0}' beëindigd om: ", calculation.Name), msgs[1]); - StringAssert.StartsWith(string.Format("Berekening van '{0}' gestart om: ", calculation.Name), msgs[2]); + StringAssert.StartsWith($"Validatie van '{calculation.Name}' gestart om: ", msgs[0]); + StringAssert.StartsWith($"Validatie van '{calculation.Name}' beëindigd om: ", msgs[1]); + StringAssert.StartsWith($"Berekening van '{calculation.Name}' gestart om: ", msgs[2]); StringAssert.StartsWith("Betrouwbaarheid sluiting kunstwerk berekening is uitgevoerd op de tijdelijke locatie", msgs[3]); - StringAssert.StartsWith(string.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[4]); - StringAssert.StartsWith(string.Format("Uitvoeren van '{0}' is gelukt.", calculation.Name), msgs[5]); + StringAssert.StartsWith($"Berekening van '{calculation.Name}' beëindigd om: ", msgs[4]); + StringAssert.StartsWith($"Uitvoeren van '{calculation.Name}' is gelukt.", msgs[5]); }); Assert.AreNotSame(initialOutput, calculation.Output); @@ -973,8 +939,6 @@ mocks.ReplayAll(); - plugin.Gui = gui; - using (ContextMenuStrip contextMenuStrip = info.ContextMenuStrip(calculationContext, null, treeViewControl)) { // When @@ -985,8 +949,8 @@ { string[] msgs = messages.ToArray(); Assert.AreEqual(2, msgs.Length); - StringAssert.StartsWith(string.Format("Validatie van '{0}' gestart om: ", calculation.Name), msgs[0]); - StringAssert.StartsWith(string.Format("Validatie van '{0}' beëindigd om: ", calculation.Name), msgs[1]); + StringAssert.StartsWith($"Validatie van '{calculation.Name}' gestart om: ", msgs[0]); + StringAssert.StartsWith($"Validatie van '{calculation.Name}' beëindigd om: ", msgs[1]); }); } } Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -r543721804bf58d098ee833d1a023a6e0018f1452 -r7c857a9d25bf11581d83514bda0d31413eca8dd3 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationContextTreeNodeInfoTest.cs) (revision 543721804bf58d098ee833d1a023a6e0018f1452) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationContextTreeNodeInfoTest.cs) (revision 7c857a9d25bf11581d83514bda0d31413eca8dd3) @@ -1018,12 +1018,12 @@ { string[] msgs = messages.ToArray(); Assert.AreEqual(6, msgs.Length); - StringAssert.StartsWith(string.Format("Validatie van '{0}' gestart om: ", calculation.Name), msgs[0]); - StringAssert.StartsWith(string.Format("Validatie van '{0}' beëindigd om: ", calculation.Name), msgs[1]); - StringAssert.StartsWith(string.Format("Berekening van '{0}' gestart om: ", calculation.Name), msgs[2]); + StringAssert.StartsWith($"Validatie van '{calculation.Name}' gestart om: ", msgs[0]); + StringAssert.StartsWith($"Validatie van '{calculation.Name}' beëindigd om: ", msgs[1]); + StringAssert.StartsWith($"Berekening van '{calculation.Name}' gestart om: ", msgs[2]); StringAssert.StartsWith("Hoogte kunstwerk berekening is uitgevoerd op de tijdelijke locatie", msgs[3]); - StringAssert.StartsWith(string.Format("Berekening van '{0}' beëindigd om: ", calculation.Name), msgs[4]); - StringAssert.StartsWith(string.Format("Uitvoeren van '{0}' is gelukt.", calculation.Name), msgs[5]); + StringAssert.StartsWith($"Berekening van '{calculation.Name}' beëindigd om: ", msgs[4]); + StringAssert.StartsWith($"Uitvoeren van '{calculation.Name}' is gelukt.", msgs[5]); }); Assert.AreNotSame(initialOutput, calculation.Output); @@ -1082,8 +1082,8 @@ { string[] msgs = messages.ToArray(); Assert.AreEqual(2, msgs.Length); - StringAssert.StartsWith(string.Format("Validatie van '{0}' gestart om: ", calculation.Name), msgs[0]); - StringAssert.StartsWith(string.Format("Validatie van '{0}' beëindigd om: ", calculation.Name), msgs[1]); + StringAssert.StartsWith($"Validatie van '{calculation.Name}' gestart om: ", msgs[0]); + StringAssert.StartsWith($"Validatie van '{calculation.Name}' beëindigd om: ", msgs[1]); }); } }