Index: Demo/Ringtoets/src/Demo.Ringtoets/Commands/OpenMapViewCommand.cs =================================================================== diff -u -rf4b3f19758b8929693ad8653bbc3c906a75d2983 -r9a876515ea0079c4abb6dad05fce7d50df8bdaa0 --- Demo/Ringtoets/src/Demo.Ringtoets/Commands/OpenMapViewCommand.cs (.../OpenMapViewCommand.cs) (revision f4b3f19758b8929693ad8653bbc3c906a75d2983) +++ Demo/Ringtoets/src/Demo.Ringtoets/Commands/OpenMapViewCommand.cs (.../OpenMapViewCommand.cs) (revision 9a876515ea0079c4abb6dad05fce7d50df8bdaa0) @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System.Collections.Generic; using Core.Common.Base.Geometry; using Core.Common.Controls.Commands; using Core.Common.Gui.Commands; @@ -201,7 +202,7 @@ viewCommands.OpenView(mapDataCollection); } - private static MapFeature[] GetFeatureWithPoints(Point2D[] points) + private static IEnumerable GetFeatureWithPoints(Point2D[] points) { return new[] { Index: Demo/Ringtoets/src/Demo.Ringtoets/Commands/OpenThematicalMapViewCommand.cs =================================================================== diff -u --- Demo/Ringtoets/src/Demo.Ringtoets/Commands/OpenThematicalMapViewCommand.cs (revision 0) +++ Demo/Ringtoets/src/Demo.Ringtoets/Commands/OpenThematicalMapViewCommand.cs (revision 9a876515ea0079c4abb6dad05fce7d50df8bdaa0) @@ -0,0 +1,52 @@ +// Copyright (C) Stichting Deltares 2017. 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 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 General Public License for more details. +// +// You should have received a copy of the GNU 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 Core.Common.Controls.Commands; +using Core.Common.Gui.Commands; +using Core.Components.Gis.Data; + +namespace Demo.Ringtoets.Commands +{ + /// + /// The command for opening a view for with + /// categorial theming on random data. + /// + public class OpenThematicalMapViewCommand : ICommand + { + private readonly IViewCommands viewCommands; + + /// + /// Creates a new instance of . + /// + /// The to be used internally. + public OpenThematicalMapViewCommand(IViewCommands viewCommands) + { + this.viewCommands = viewCommands; + } + + public bool Checked { get; } = false; + + public void Execute() + { + viewCommands.OpenView(new object()); + } + } +} \ No newline at end of file Index: Demo/Ringtoets/src/Demo.Ringtoets/Demo.Ringtoets.csproj =================================================================== diff -u -rac96d7c315129af851634ed5a4a6800b59ede718 -r9a876515ea0079c4abb6dad05fce7d50df8bdaa0 --- Demo/Ringtoets/src/Demo.Ringtoets/Demo.Ringtoets.csproj (.../Demo.Ringtoets.csproj) (revision ac96d7c315129af851634ed5a4a6800b59ede718) +++ Demo/Ringtoets/src/Demo.Ringtoets/Demo.Ringtoets.csproj (.../Demo.Ringtoets.csproj) (revision 9a876515ea0079c4abb6dad05fce7d50df8bdaa0) @@ -26,6 +26,7 @@ + Index: Demo/Ringtoets/test/Demo.Ringtoets.Test/Commands/OpenThematicalMapViewCommandTest.cs =================================================================== diff -u --- Demo/Ringtoets/test/Demo.Ringtoets.Test/Commands/OpenThematicalMapViewCommandTest.cs (revision 0) +++ Demo/Ringtoets/test/Demo.Ringtoets.Test/Commands/OpenThematicalMapViewCommandTest.cs (revision 9a876515ea0079c4abb6dad05fce7d50df8bdaa0) @@ -0,0 +1,84 @@ +// Copyright (C) Stichting Deltares 2017. 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 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 General Public License for more details. +// +// You should have received a copy of the GNU 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 Core.Common.Controls.Commands; +using Core.Common.Gui.Commands; +using Demo.Ringtoets.Commands; +using NUnit.Framework; +using Rhino.Mocks; + +namespace Demo.Ringtoets.Test.Commands +{ + [TestFixture] + public class OpenThematicalMapViewCommandTest + { + [Test] + public void ParameteredConstructor_DefaultValues() + { + // Setup + var mocks = new MockRepository(); + var viewCommands = mocks.Stub(); + mocks.ReplayAll(); + + // Call + var command = new OpenThematicalMapViewCommand(viewCommands); + + // Assert + Assert.IsInstanceOf(command); + Assert.IsFalse(command.Checked); + mocks.VerifyAll(); + } + + [Test] + public void Execute_Always_OpensViewForMapData() + { + // Setup + var mocks = new MockRepository(); + var viewCommands = mocks.StrictMock(); + viewCommands.Expect(g => g.OpenView(Arg.Is.NotNull)); + mocks.ReplayAll(); + + var command = new OpenThematicalMapViewCommand(viewCommands); + + // Call + command.Execute(); + + // Assert + mocks.VerifyAll(); + } + + [Test] + public void Checked_Always_ReturnsFalse() + { + // Setup + var mocks = new MockRepository(); + var viewCommands = mocks.Stub(); + mocks.ReplayAll(); + + // Call + var command = new OpenThematicalMapViewCommand(viewCommands); + + // Assert + Assert.IsFalse(command.Checked); + mocks.VerifyAll(); + } + } +} \ No newline at end of file Index: Demo/Ringtoets/test/Demo.Ringtoets.Test/Demo.Ringtoets.Test.csproj =================================================================== diff -u -r63fc151e9cf722527465c1eddfa6567a90feb5e6 -r9a876515ea0079c4abb6dad05fce7d50df8bdaa0 --- Demo/Ringtoets/test/Demo.Ringtoets.Test/Demo.Ringtoets.Test.csproj (.../Demo.Ringtoets.Test.csproj) (revision 63fc151e9cf722527465c1eddfa6567a90feb5e6) +++ Demo/Ringtoets/test/Demo.Ringtoets.Test/Demo.Ringtoets.Test.csproj (.../Demo.Ringtoets.Test.csproj) (revision 9a876515ea0079c4abb6dad05fce7d50df8bdaa0) @@ -33,6 +33,7 @@ +