Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #2758. ReSharper unit tests detects errors that VS2022 don't. #2759

Merged
merged 1 commit into from
Jul 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions UnitTests/TestHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using System.Text.RegularExpressions;
using System.Reflection;
using System.Diagnostics;
using System.Globalization;


// This class enables test functions annotated with the [AutoInitShutdown] attribute to
Expand All @@ -27,15 +28,15 @@ public class AutoInitShutdownAttribute : Xunit.Sdk.BeforeAfterTestAttribute {
/// </summary>
/// <param name="autoInit">If true, Application.Init will be called Before the test runs.</param>
/// <param name="autoShutdown">If true, Application.Shutdown will be called After the test runs.</param>
/// <param name="consoleDriverType">Determins which ConsoleDriver (FakeDriver, WindowsDriver,
/// CursesDriver, NetDriver) will be used when Appliation.Init is called. If null FakeDriver will be used.
/// <param name="consoleDriverType">Determines which ConsoleDriver (FakeDriver, WindowsDriver,
/// CursesDriver, NetDriver) will be used when Application.Init is called. If null FakeDriver will be used.
/// Only valid if <paramref name="autoInit"/> is true.</param>
/// <param name="useFakeClipboard">If true, will force the use of <see cref="FakeDriver.FakeClipboard"/>.
/// Only valid if <see cref="consoleDriver"/> == <see cref="FakeDriver"/> and <paramref name="autoInit"/> is true.</param>
/// Only valid if <see cref="ConsoleDriver"/> == <see cref="FakeDriver"/> and <paramref name="autoInit"/> is true.</param>
/// <param name="fakeClipboardAlwaysThrowsNotSupportedException">Only valid if <paramref name="autoInit"/> is true.
/// Only valid if <see cref="consoleDriver"/> == <see cref="FakeDriver"/> and <paramref name="autoInit"/> is true.</param>
/// Only valid if <see cref="ConsoleDriver"/> == <see cref="FakeDriver"/> and <paramref name="autoInit"/> is true.</param>
/// <param name="fakeClipboardIsSupportedAlwaysTrue">Only valid if <paramref name="autoInit"/> is true.
/// Only valid if <see cref="consoleDriver"/> == <see cref="FakeDriver"/> and <paramref name="autoInit"/> is true.</param>
/// Only valid if <see cref="ConsoleDriver"/> == <see cref="FakeDriver"/> and <paramref name="autoInit"/> is true.</param>
public AutoInitShutdownAttribute (bool autoInit = true, bool autoShutdown = true,
Type consoleDriverType = null,
bool useFakeClipboard = false,
Expand All @@ -44,6 +45,7 @@ public AutoInitShutdownAttribute (bool autoInit = true, bool autoShutdown = true
{
//Assert.True (autoInit == false && consoleDriverType == null);

CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.GetCultureInfo ("en-US");
AutoInit = autoInit;
AutoShutdown = autoShutdown;
DriverType = consoleDriverType ?? typeof (FakeDriver);
Expand Down