Skip to content

Commit

Permalink
Update TestExecuteCommandClearUserSettings.cs
Browse files Browse the repository at this point in the history
Address review comments
  • Loading branch information
jas88 committed Aug 11, 2023
1 parent 42d09db commit cc0d397
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) The University of Dundee 2018-2019
// Copyright (c) The University of Dundee 2018-2023
// This file is part of the Research Data Management Platform (RDMP).
// RDMP 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.
// RDMP 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.
Expand All @@ -12,21 +12,23 @@

namespace Rdmp.Core.Tests.CommandExecution;

internal class TestExecuteCommandClearUserSettings : CommandCliTests
internal sealed class TestExecuteCommandClearUserSettings : CommandCliTests
{
[Test]
public void Test_ClearUserSettings()
{
var invoker = GetInvoker();
var activator = GetActivator();

UserSettings.Wait5SecondsAfterStartupUI = false;

GetInvoker().ExecuteCommand(typeof(ExecuteCommandSetUserSetting), new CommandLineObjectPicker(new[] { nameof(UserSettings.Wait5SecondsAfterStartupUI), "true" }, GetActivator()));
invoker.ExecuteCommand(typeof(ExecuteCommandSetUserSetting), new CommandLineObjectPicker(new[] { nameof(UserSettings.Wait5SecondsAfterStartupUI), "true" }, activator));

Assert.IsTrue(UserSettings.Wait5SecondsAfterStartupUI);
GetInvoker().ExecuteCommand(typeof(ExecuteCommandSetUserSetting), new CommandLineObjectPicker(new[] { nameof(UserSettings.Wait5SecondsAfterStartupUI), "false" }, GetActivator()));
invoker.ExecuteCommand(typeof(ExecuteCommandSetUserSetting), new CommandLineObjectPicker(new[] { nameof(UserSettings.Wait5SecondsAfterStartupUI), "false" }, activator));
Assert.IsFalse(UserSettings.Wait5SecondsAfterStartupUI);
GetInvoker().ExecuteCommand(typeof(ExecuteCommandClearUserSettings), new CommandLineObjectPicker(new string[] { }, GetActivator()));
invoker.ExecuteCommand(typeof(ExecuteCommandClearUserSettings), new CommandLineObjectPicker(System.Array.Empty<string>(), activator));

Assert.IsTrue(UserSettings.Wait5SecondsAfterStartupUI);

}
}

0 comments on commit cc0d397

Please sign in to comment.