Index: Core/Common/test/Core.Common.Gui.Test/Core.Common.Gui.Test.csproj =================================================================== diff -u -r0ebf7ee0c2ee3cefb8f3d0eed09e702780e85c4b -rdf62b6b1369bd3eede1167c4e5a73862ddd809f9 --- Core/Common/test/Core.Common.Gui.Test/Core.Common.Gui.Test.csproj (.../Core.Common.Gui.Test.csproj) (revision 0ebf7ee0c2ee3cefb8f3d0eed09e702780e85c4b) +++ Core/Common/test/Core.Common.Gui.Test/Core.Common.Gui.Test.csproj (.../Core.Common.Gui.Test.csproj) (revision df62b6b1369bd3eede1167c4e5a73862ddd809f9) @@ -118,6 +118,8 @@ + + Index: Core/Common/test/Core.Common.Gui.Test/Forms/MessageWindow/MessageWindowTest.cs =================================================================== diff -u -rce9283562cfceedb1933f67ee8a0c3b344331a8f -rdf62b6b1369bd3eede1167c4e5a73862ddd809f9 --- Core/Common/test/Core.Common.Gui.Test/Forms/MessageWindow/MessageWindowTest.cs (.../MessageWindowTest.cs) (revision ce9283562cfceedb1933f67ee8a0c3b344331a8f) +++ Core/Common/test/Core.Common.Gui.Test/Forms/MessageWindow/MessageWindowTest.cs (.../MessageWindowTest.cs) (revision df62b6b1369bd3eede1167c4e5a73862ddd809f9) @@ -65,8 +65,9 @@ Assert.AreSame(logAppender, MessageWindowLogAppender.Instance); using (var form = new Form()) + using (var messageWindow = new Gui.Forms.MessageWindow.MessageWindow(null)) { - form.Controls.Add(new Gui.Forms.MessageWindow.MessageWindow(null)); + form.Controls.Add(messageWindow); form.Show(); var button = new ToolStripButtonTester("buttonShowDetails"); @@ -90,8 +91,8 @@ Assert.AreSame(logAppender, MessageWindowLogAppender.Instance); using (var form = new Form()) + using (var messageWindow = new Gui.Forms.MessageWindow.MessageWindow(dialogParent)) { - var messageWindow = new Gui.Forms.MessageWindow.MessageWindow(dialogParent); form.Controls.Add(messageWindow); form.Show(); Index: Core/Common/test/Core.Common.Gui.Test/Forms/SelectItemDialogTest.cs =================================================================== diff -u --- Core/Common/test/Core.Common.Gui.Test/Forms/SelectItemDialogTest.cs (revision 0) +++ Core/Common/test/Core.Common.Gui.Test/Forms/SelectItemDialogTest.cs (revision df62b6b1369bd3eede1167c4e5a73862ddd809f9) @@ -0,0 +1,60 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Windows.Forms; +using Core.Common.Gui.Forms; +using NUnit.Framework; +using Rhino.Mocks; + +namespace Core.Common.Gui.Test.Forms +{ + [TestFixture] + public class SelectItemDialogTest + { + [Test] + public void Constructor_WithoutDialogParent_ThrowsArgumentNullException() + { + // Call + TestDelegate test = () => new SelectItemDialog(null); + + // Assert + var paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("dialogParent", paramName); + } + + [Test] + public void Constructor_WithDialogParent_SetProperties() + { + var mocks = new MockRepository(); + var parent = mocks.StrictMock(); + mocks.ReplayAll(); + + // Call + using (var dialog = new SelectItemDialog(parent)) + { + // Assert + Assert.IsNull(dialog.SelectedItemTag); + Assert.IsNull(dialog.SelectedItemTypeName); + } + } + } +} \ No newline at end of file Index: Core/Common/test/Core.Common.Gui.Test/Forms/SelectViewDialogTest.cs =================================================================== diff -u --- Core/Common/test/Core.Common.Gui.Test/Forms/SelectViewDialogTest.cs (revision 0) +++ Core/Common/test/Core.Common.Gui.Test/Forms/SelectViewDialogTest.cs (revision df62b6b1369bd3eede1167c4e5a73862ddd809f9) @@ -0,0 +1,61 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Windows.Forms; +using Core.Common.Gui.Forms; +using NUnit.Framework; +using Rhino.Mocks; + +namespace Core.Common.Gui.Test.Forms +{ + [TestFixture] + public class SelectViewDialogTest + { + [Test] + public void Constructor_WithoutDialogParent_ThrowsArgumentNullException() + { + // Call + TestDelegate test = () => new SelectViewDialog(null); + + // Assert + var paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("dialogParent", paramName); + } + + [Test] + public void Constructor_WithDialogParent_SetProperties() + { + var mocks = new MockRepository(); + var parent = mocks.StrictMock(); + mocks.ReplayAll(); + + // Call + using (var dialog = new SelectViewDialog(parent)) + { + // Assert + Assert.IsNull(dialog.DefaultViewName); + Assert.IsNull(dialog.SelectedItem); + Assert.IsNull(dialog.Items); + } + } + } +} \ No newline at end of file