Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/BackgroundMapDataSelectionDialogTest.cs =================================================================== diff -u -rf35a1bdec32700c5cb0027d714c8a51dfc118e0d -r38abc823a892327c367dfbf8edf2101ff3eb1d22 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/BackgroundMapDataSelectionDialogTest.cs (.../BackgroundMapDataSelectionDialogTest.cs) (revision f35a1bdec32700c5cb0027d714c8a51dfc118e0d) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/BackgroundMapDataSelectionDialogTest.cs (.../BackgroundMapDataSelectionDialogTest.cs) (revision 38abc823a892327c367dfbf8edf2101ff3eb1d22) @@ -41,27 +41,31 @@ [Test] public void Constructor_WithoutParent_ThrowsArgumentNullException() { + // Setup + WmtsMapData mapData = WmtsMapData.CreateDefaultPdokMapData(); + // Call - TestDelegate test = () => new BackgroundMapDataSelectionDialog(null); + TestDelegate test = () => new BackgroundMapDataSelectionDialog(null, mapData); // Assert string parameter = Assert.Throws(test).ParamName; Assert.AreEqual("dialogParent", parameter); } [Test] - public void Constructor_WithParent_DefaultProperties() + public void Constructor_WithValidArguments_DefaultProperties() { // Setup + WmtsMapData mapData = WmtsMapData.CreateDefaultPdokMapData(); using (var dialogParent = new Form()) { // Call - using (var dialog = new BackgroundMapDataSelectionDialog(dialogParent)) + using (var dialog = new BackgroundMapDataSelectionDialog(dialogParent, mapData)) { // Assert Assert.IsInstanceOf(dialog); Assert.AreEqual(@"Selecteer achtergrondkaart", dialog.Text); - Assert.IsNull(dialog.SelectedMapData); + Assert.AreSame(mapData, dialog.SelectedMapData); Icon icon = BitmapToIcon(RingtoetsCommonFormsResources.SelectionDialogIcon); Bitmap expectedImage = icon.ToBitmap(); @@ -78,7 +82,7 @@ } [Test] - public void MapDataConstructor_MapDataNull_DefaultProperties() + public void Constructor_MapDataNull_DefaultProperties() { // Setup var mockRepository = new MockRepository(); @@ -98,7 +102,7 @@ public void MapDataConstructor_ParentNull_ThrowsArgumentNullException() { // Setup - var mapData = new WmtsMapData("1", "2", "3", "image/"); + WmtsMapData mapData = WmtsMapData.CreateDefaultPdokMapData(); // Call TestDelegate test = () => new BackgroundMapDataSelectionDialog(null, mapData); @@ -112,7 +116,7 @@ public void MapDataConstructor_WithParents_DefaultProperties() { // Setup - var mapData = new WmtsMapData("1", "2", "3", "image/"); + WmtsMapData mapData = WmtsMapData.CreateDefaultPdokMapData(); using (var dialogParent = new Form()) { // Call @@ -148,7 +152,7 @@ }; using (var dialogParent = new Form()) - using (var dialog = new BackgroundMapDataSelectionDialog(dialogParent)) + using (var dialog = new BackgroundMapDataSelectionDialog(dialogParent, null)) { // Call dialog.ShowDialog(); @@ -193,7 +197,7 @@ }; using (var dialogParent = new Form()) - using (var dialog = new BackgroundMapDataSelectionDialog(dialogParent)) + using (var dialog = new BackgroundMapDataSelectionDialog(dialogParent, null)) { // When dialog.ShowDialog(); @@ -211,7 +215,7 @@ TestDelegate call = () => { using (var dialogParent = new Form()) - using (var dialog = new BackgroundMapDataSelectionDialog(dialogParent)) + using (var dialog = new BackgroundMapDataSelectionDialog(dialogParent, null)) { dialog.Dispose(); }