Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismResultViewTest.cs =================================================================== diff -u -r1ed4c3d0bf61e04b9a3069977c76c183b2cc072a -r84223425c4ab8eec2440f512b5b06bea8937f8f9 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismResultViewTest.cs (.../FailureMechanismResultViewTest.cs) (revision 1ed4c3d0bf61e04b9a3069977c76c183b2cc072a) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismResultViewTest.cs (.../FailureMechanismResultViewTest.cs) (revision 84223425c4ab8eec2440f512b5b06bea8937f8f9) @@ -24,15 +24,12 @@ using System.Drawing; using System.Windows.Forms; using Core.Common.Base; -using Core.Common.Controls; using Core.Common.Controls.DataGrid; using Core.Common.Controls.Views; using Core.Common.TestUtil; using Core.Common.Util.Reflection; using NUnit.Extensions.Forms; using NUnit.Framework; -using Ringtoets.AssemblyTool.Data; -using Ringtoets.AssemblyTool.KernelWrapper.TestUtil.Calculators; using Ringtoets.Common.Data.Exceptions; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.TestUtil; @@ -338,22 +335,18 @@ sectionResult }; - using (new AssemblyToolCalculatorFactoryConfig()) using (TestFailureMechanismResultView view = ShowFailureMechanismResultsView(sectionResults)) { // Precondition - BorderedLabel assemblyGroupLabel = GetGroupLabel(); FailureMechanismAssemblyCategoryGroupControl resultControl = GetFailureMechanismAssemblyCategoryGroupControl(); ErrorProvider errorProvider = GetErrorProvider(resultControl); - Assert.AreEqual(Color.FromArgb(255, 255, 0), assemblyGroupLabel.BackColor); Assert.IsEmpty(errorProvider.GetError(resultControl)); // When view.ThrowExceptionOnCalculate = true; sectionResult.NotifyObservers(); // Then - Assert.AreEqual(Color.White, assemblyGroupLabel.BackColor); Assert.AreEqual("Message", errorProvider.GetError(resultControl)); } } @@ -369,25 +362,21 @@ sectionResult }; - using (new AssemblyToolCalculatorFactoryConfig()) using (TestFailureMechanismResultView view = ShowFailureMechanismResultsView(sectionResults)) { view.ThrowExceptionOnCalculate = true; sectionResult.NotifyObservers(); // Precondition - BorderedLabel assemblyGroupLabel = GetGroupLabel(); FailureMechanismAssemblyCategoryGroupControl resultControl = GetFailureMechanismAssemblyCategoryGroupControl(); ErrorProvider errorProvider = GetErrorProvider(resultControl); - Assert.AreEqual(Color.White, assemblyGroupLabel.BackColor); Assert.AreEqual("Message", errorProvider.GetError(resultControl)); // When view.ThrowExceptionOnCalculate = false; sectionResult.NotifyObservers(); // Then - Assert.AreEqual(Color.FromArgb(255, 255, 0), assemblyGroupLabel.BackColor); Assert.IsEmpty(errorProvider.GetError(resultControl)); } } @@ -465,7 +454,7 @@ private static ErrorProvider GetErrorProvider(FailureMechanismAssemblyCategoryGroupControl resultControl) { - return TypeUtils.GetField(resultControl, "ErrorProvider"); + return TypeUtils.GetField(resultControl, "errorProvider"); } private static FailureMechanismAssemblyCategoryGroupControl GetFailureMechanismAssemblyCategoryGroupControl() @@ -482,11 +471,6 @@ return failureMechanismResultView; } - private static BorderedLabel GetGroupLabel() - { - return (BorderedLabel) new ControlTester("GroupLabel").TheObject; - } - private class TestFailureMechanismResultView : FailureMechanismResultView, TestFailureMechanism, FailureMechanismAssemblyCategoryGroupControl> { public TestFailureMechanismResultView(IObservableEnumerable failureMechanismSectionResults, TestFailureMechanism failureMechanism) @@ -513,7 +497,6 @@ throw new AssemblyException("Message"); } - FailureMechanismAssemblyResultControl.SetAssemblyResult(FailureMechanismAssemblyCategoryGroup.IIIt); AssemblyResultUpdated = true; } }