Fisheye: Tag fbb25060f6e9379366bc59fac681d38a7ac8a091 refers to a dead (removed) revision in file `Application/Ringtoets/test/Application.Ringtoets.Test/AppTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fbb25060f6e9379366bc59fac681d38a7ac8a091 refers to a dead (removed) revision in file `Application/Ringtoets/test/Application.Ringtoets.Test/Application.Ringtoets.Test.csproj'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fbb25060f6e9379366bc59fac681d38a7ac8a091 refers to a dead (removed) revision in file `Application/Ringtoets/test/Application.Ringtoets.Test/Properties/AssemblyInfo.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag fbb25060f6e9379366bc59fac681d38a7ac8a091 refers to a dead (removed) revision in file `Application/Ringtoets/test/Application.Ringtoets.Test/packages.config'. Fisheye: No comparison available. Pass `N' to diff? Index: Application/Ringtoets/test/Application.Riskeer.Test/AppTest.cs =================================================================== diff -u --- Application/Ringtoets/test/Application.Riskeer.Test/AppTest.cs (revision 0) +++ Application/Ringtoets/test/Application.Riskeer.Test/AppTest.cs (revision fbb25060f6e9379366bc59fac681d38a7ac8a091) @@ -0,0 +1,105 @@ +// Copyright (C) Stichting Deltares 2018. 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 System; +using System.DirectoryServices.AccountManagement; +using System.Linq; +using Core.Common.TestUtil; +using Core.Common.Util.Settings; +using NUnit.Framework; +using Ringtoets.Integration.Forms; + +namespace Application.Riskeer.Test +{ + [TestFixture] + public class AppTest + { + private AppDomain appDomain; + + [SetUp] + public void SetUp() + { + appDomain = AppDomain.CreateDomain("AppTest", AppDomain.CurrentDomain.Evidence, + AppDomain.CurrentDomain.SetupInformation); + } + + [TearDown] + public void TearDown() + { + AppDomain.Unload(appDomain); + } + + [Test] + public void Constructor_ExpectedValues() + { + // Setup + appDomain.DoCallBack(() => + { + // Call + var app = new App(); + + // Assert + Assert.IsInstanceOf(app); + Assert.IsInstanceOf(SettingsHelper.Instance); + app.Shutdown(); + }); + } + + [Test] + public void Constructor_LogsStartupMessage() + { + // Setup + appDomain.DoCallBack(() => + { + // Call + Action call = () => + { + var app = new App(); + app.Shutdown(); + }; + + // Assert + string userDisplayInfo = UserDisplay(); + + TestHelper.AssertLogMessages(call, messages => + { + string[] msgs = messages.ToArray(); + Assert.AreEqual(1, msgs.Length); + Assert.AreEqual($"Riskeer versie {SettingsHelper.Instance.ApplicationVersion} wordt gestart door {userDisplayInfo}...", msgs[0]); + }); + }); + } + + private static string UserDisplay() + { + try + { + return $"{UserPrincipal.Current.DisplayName} ({UserPrincipal.Current.SamAccountName})"; + } + catch (SystemException) + { + // Cannot only catch specified exceptions, as there are some hidden exception + // that can be thrown when calling UserPrincipal.Current. + return Environment.UserName; + } + } + } +} \ No newline at end of file Index: Application/Ringtoets/test/Application.Riskeer.Test/Application.Riskeer.Test.csproj =================================================================== diff -u --- Application/Ringtoets/test/Application.Riskeer.Test/Application.Riskeer.Test.csproj (revision 0) +++ Application/Ringtoets/test/Application.Riskeer.Test/Application.Riskeer.Test.csproj (revision fbb25060f6e9379366bc59fac681d38a7ac8a091) @@ -0,0 +1,50 @@ + + + + {A2451981-99DA-4605-8396-F2222D25EBB7} + Application.Riskeer.Test + Application.Riskeer.Test + + + + + ..\..\..\..\packages\NUnit.3.8.1\lib\net40\nunit.framework.dll + True + + + + + + + + + + + + + + + + Copying.licenseheader + + + + + + {F49BD8B2-332A-4C91-A196-8CCE0A2C7D98} + Core.Common.Util + + + {D749EE4C-CE50-4C17-BF01-9A953028C126} + Core.Common.TestUtil + + + {AD0CDC89-0A00-4068-AEEC-9838863C2FE8} + Ringtoets.Integration.Forms + + + {4A7D6720-4AA1-4F0B-A796-A0436DB3D7D7} + Application.Riskeer + + + \ No newline at end of file Index: Application/Ringtoets/test/Application.Riskeer.Test/Properties/AssemblyInfo.cs =================================================================== diff -u --- Application/Ringtoets/test/Application.Riskeer.Test/Properties/AssemblyInfo.cs (revision 0) +++ Application/Ringtoets/test/Application.Riskeer.Test/Properties/AssemblyInfo.cs (revision fbb25060f6e9379366bc59fac681d38a7ac8a091) @@ -0,0 +1,25 @@ +// Copyright (C) Stichting Deltares 2018. 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 System.Reflection; + +[assembly: AssemblyTitle("Application.Riskeer.Test")] +[assembly: AssemblyProduct("Application.Riskeer.Test")] \ No newline at end of file Index: Application/Ringtoets/test/Application.Riskeer.Test/packages.config =================================================================== diff -u --- Application/Ringtoets/test/Application.Riskeer.Test/packages.config (revision 0) +++ Application/Ringtoets/test/Application.Riskeer.Test/packages.config (revision fbb25060f6e9379366bc59fac681d38a7ac8a091) @@ -0,0 +1,26 @@ + + + + + \ No newline at end of file Index: Ringtoets.sln =================================================================== diff -u -rba8f5d8f0bc75ecf1792534019c6b84a2378e395 -rfbb25060f6e9379366bc59fac681d38a7ac8a091 --- Ringtoets.sln (.../Ringtoets.sln) (revision ba8f5d8f0bc75ecf1792534019c6b84a2378e395) +++ Ringtoets.sln (.../Ringtoets.sln) (revision fbb25060f6e9379366bc59fac681d38a7ac8a091) @@ -716,7 +716,7 @@ {C90B77DA-E421-43CC-B82E-529651BC21AC} = {C90B77DA-E421-43CC-B82E-529651BC21AC} EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Application.Ringtoets.Test", "Application\Ringtoets\test\Application.Ringtoets.Test\Application.Ringtoets.Test.csproj", "{A2451981-99DA-4605-8396-F2222D25EBB7}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Application.Riskeer.Test", "Application\Ringtoets\test\Application.Riskeer.Test\Application.Riskeer.Test.csproj", "{A2451981-99DA-4605-8396-F2222D25EBB7}" ProjectSection(ProjectDependencies) = postProject {C90B77DA-E421-43CC-B82E-529651BC21AC} = {C90B77DA-E421-43CC-B82E-529651BC21AC} EndProjectSection