Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r37a6f89101a0da3b109a364c8d705ae67e56a9c5 -raa964c373f22074011daf5673e15963f6d1d31e9 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 37a6f89101a0da3b109a364c8d705ae67e56a9c5) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision aa964c373f22074011daf5673e15963f6d1d31e9) @@ -166,15 +166,6 @@ } /// - /// Looks up a localized string similar to Assemblageresultaat verversen. - /// - public static string AssemblyResultTotalView_RefreshAssemblyResultsButton_Text { - get { - return ResourceManager.GetString("AssemblyResultTotalView_RefreshAssemblyResultsButton_Text", resourceCulture); - } - } - - /// /// Looks up a localized string similar to ID van het traject.. /// public static string AssessmentSection_Id_Description { Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.resx =================================================================== diff -u -r37a6f89101a0da3b109a364c8d705ae67e56a9c5 -raa964c373f22074011daf5673e15963f6d1d31e9 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.resx (.../Resources.resx) (revision 37a6f89101a0da3b109a364c8d705ae67e56a9c5) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Properties/Resources.resx (.../Resources.resx) (revision aa964c373f22074011daf5673e15963f6d1d31e9) @@ -381,9 +381,6 @@ Benaderde faalkans - - Assemblageresultaat verversen - Toetsspoor Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultTotalView.Designer.cs =================================================================== diff -u -r5562ec9835fa2ad44ede7aa031e80c3e9a368445 -raa964c373f22074011daf5673e15963f6d1d31e9 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultTotalView.Designer.cs (.../AssemblyResultTotalView.Designer.cs) (revision 5562ec9835fa2ad44ede7aa031e80c3e9a368445) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultTotalView.Designer.cs (.../AssemblyResultTotalView.Designer.cs) (revision aa964c373f22074011daf5673e15963f6d1d31e9) @@ -59,6 +59,7 @@ this.RefreshAssemblyResultsButton.Name = "RefreshAssemblyResultsButton"; this.RefreshAssemblyResultsButton.Size = new System.Drawing.Size(164, 23); this.RefreshAssemblyResultsButton.TabIndex = 0; + this.RefreshAssemblyResultsButton.Text = "Assemblageresultaat verversen"; this.RefreshAssemblyResultsButton.UseVisualStyleBackColor = true; this.RefreshAssemblyResultsButton.Click += new System.EventHandler(this.RefreshAssemblyResults_Click); // Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultTotalView.cs =================================================================== diff -u -r641147134a5785ec9a090a1a9966a0b15e74999b -raa964c373f22074011daf5673e15963f6d1d31e9 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultTotalView.cs (.../AssemblyResultTotalView.cs) (revision 641147134a5785ec9a090a1a9966a0b15e74999b) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultTotalView.cs (.../AssemblyResultTotalView.cs) (revision aa964c373f22074011daf5673e15963f6d1d31e9) @@ -80,7 +80,6 @@ { base.OnLoad(e); - LocalizeControl(); InitializeDataGridView(); dataGridViewControl.CellFormatting += HandleCellStyling; @@ -97,11 +96,6 @@ base.Dispose(disposing); } - private void LocalizeControl() - { - RefreshAssemblyResultsButton.Text = Resources.AssemblyResultTotalView_RefreshAssemblyResultsButton_Text; - } - private void InitializeDataGridView() { dataGridViewControl.AddTextBoxColumn(nameof(FailureMechanismAssemblyResultRowBase.Name), Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssemblyResultTotalViewTest.cs =================================================================== diff -u -rc05d1ef136bcd8e31ce35f00d87168e359d36f3e -raa964c373f22074011daf5673e15963f6d1d31e9 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssemblyResultTotalViewTest.cs (.../AssemblyResultTotalViewTest.cs) (revision c05d1ef136bcd8e31ce35f00d87168e359d36f3e) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssemblyResultTotalViewTest.cs (.../AssemblyResultTotalViewTest.cs) (revision aa964c373f22074011daf5673e15963f6d1d31e9) @@ -23,6 +23,7 @@ using System.Drawing; using System.Linq; using System.Windows.Forms; +using Core.Common.Controls.DataGrid; using Core.Common.Controls.Views; using Core.Common.TestUtil; using NUnit.Extensions.Forms; @@ -93,15 +94,21 @@ var assessmentSection = new AssessmentSection(random.NextEnumValue()); // Call - using (AssemblyResultTotalView view = ShowAssemblyResultTotalView(assessmentSection)) + using (var view = new AssemblyResultTotalView(assessmentSection)) { + testForm.Controls.Add(view); + testForm.Show(); + // Assert Assert.AreEqual(2, view.Controls.Count); var button = (Button) new ControlTester("RefreshAssemblyResultsButton").TheObject; Assert.AreEqual("Assemblageresultaat verversen", button.Text); Assert.IsTrue(button.Enabled); + var datagridViewControl = (DataGridViewControl) new ControlTester("dataGridViewControl").TheObject; + Assert.AreEqual(DockStyle.Fill, datagridViewControl.Dock); + Assert.IsInstanceOf(view); Assert.IsInstanceOf(view); Assert.IsNull(view.Data); @@ -144,19 +151,16 @@ public void GivenFormWithAssemblyResultTotalView_ThenExpectedRowsVisible() { // Given - var random = new Random(21); - var assessmentSection = new AssessmentSection(random.NextEnumValue()); - using (new AssemblyToolCalculatorFactoryConfig()) { var calculatorfactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; FailureMechanismAssemblyCalculatorStub calculator = calculatorfactory.LastCreatedFailureMechanismAssemblyCalculator; - using (ShowAssemblyResultTotalView(assessmentSection)) + using (AssemblyResultTotalView view = ShowAssemblyResultTotalView()) { // Then var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; - AssertFailureMechanismRows(assessmentSection, + AssertFailureMechanismRows(view.AssessmentSection, calculator.FailureMechanismAssemblyOutput, calculator.FailureMechanismAssemblyCategoryGroupOutput.Value, dataGridView.Rows); @@ -170,18 +174,17 @@ { // Given var random = new Random(21); - var assessmentSection = new AssessmentSection(random.NextEnumValue()); using (new AssemblyToolCalculatorFactoryConfig()) - using (AssemblyResultTotalView view = ShowAssemblyResultTotalView(assessmentSection)) + using (AssemblyResultTotalView view = ShowAssemblyResultTotalView()) { var calculatorfactory = (TestAssemblyToolCalculatorFactory) AssemblyToolCalculatorFactory.Instance; FailureMechanismAssemblyCalculatorStub calculator = calculatorfactory.LastCreatedFailureMechanismAssemblyCalculator; // Precondition var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; DataGridViewRowCollection rows = dataGridView.Rows; - AssertFailureMechanismRows(assessmentSection, + AssertFailureMechanismRows(view.AssessmentSection, calculator.FailureMechanismAssemblyOutput, calculator.FailureMechanismAssemblyCategoryGroupOutput.Value, rows); @@ -195,7 +198,7 @@ buttonTester.Click(); // Then - AssertFailureMechanismRows(assessmentSection, newAssemblyResult, newCategoryGroup, rows); + AssertFailureMechanismRows(view.AssessmentSection, newAssemblyResult, newCategoryGroup, rows); } } @@ -204,11 +207,8 @@ public void GivenFormWithAssemblyResultTotalViewWithoutErrors_WhenRefreshingAssemblyResultsAndExceptionThrown_ThenErrorTextSet() { // Given - var random = new Random(21); - var assessmentSection = new AssessmentSection(random.NextEnumValue()); - using (new AssemblyToolCalculatorFactoryConfig()) - using (AssemblyResultTotalView view = ShowAssemblyResultTotalView(assessmentSection)) + using (AssemblyResultTotalView view = ShowAssemblyResultTotalView()) { testForm.Controls.Add(view); testForm.Show(); @@ -219,7 +219,7 @@ // Precondition var dataGridView = (DataGridView)new ControlTester("dataGridView").TheObject; DataGridViewRowCollection rows = dataGridView.Rows; - AssertFailureMechanismRowsWithoutErrorText(assessmentSection, rows); + AssertFailureMechanismRowsWithoutErrorText(view.AssessmentSection, rows); // When calculator.ThrowExceptionOnCalculate = true; @@ -228,7 +228,7 @@ buttonTester.Click(); // Then - AssertFailureMechanismRowsWithErrorText(assessmentSection, exceptionMessage, rows); + AssertFailureMechanismRowsWithErrorText(view.AssessmentSection, exceptionMessage, rows); } } @@ -391,21 +391,16 @@ return rowCells[failureMechanismAssemblyCategoryColumnIndex]; } - private AssemblyResultTotalView ShowAssemblyResultTotalView(AssessmentSection assessmentSection) + private AssemblyResultTotalView ShowAssemblyResultTotalView() { + var random = new Random(21); + var assessmentSection = new AssessmentSection(random.NextEnumValue()); + var view = new AssemblyResultTotalView(assessmentSection); testForm.Controls.Add(view); testForm.Show(); return view; } - - private AssemblyResultTotalView ShowAssemblyResultTotalView() - { - var random = new Random(21); - var assessmentSection = new AssessmentSection(random.NextEnumValue()); - - return ShowAssemblyResultTotalView(assessmentSection); - } } } \ No newline at end of file