mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Moving test to Application folder
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
using UnitTests;
|
||||
|
||||
namespace UnitTests_Parallelizable.ApplicationTests;
|
||||
|
||||
public class ApplicationForceDriverTests : FakeDriverBase
|
||||
{
|
||||
[Fact]
|
||||
public void ForceDriver_Does_Not_Changes_If_It_Has_Valid_Value ()
|
||||
{
|
||||
Assert.False (Application.Initialized);
|
||||
Assert.Null (Application.Driver);
|
||||
Assert.Equal (string.Empty, Application.ForceDriver);
|
||||
|
||||
Application.ForceDriver = "fake";
|
||||
Assert.Equal ("fake", Application.ForceDriver);
|
||||
|
||||
Application.ForceDriver = "dotnet";
|
||||
Assert.Equal ("fake", Application.ForceDriver);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ForceDriver_Throws_If_Initialized_Changed_To_Another_Value ()
|
||||
{
|
||||
IDriver driver = CreateFakeDriver ();
|
||||
|
||||
Assert.False (Application.Initialized);
|
||||
Assert.Null (Application.Driver);
|
||||
Assert.Equal (string.Empty, Application.ForceDriver);
|
||||
|
||||
Application.Init (driver);
|
||||
Assert.True (Application.Initialized);
|
||||
Assert.NotNull (Application.Driver);
|
||||
Assert.Equal ("fake", Application.Driver.GetName ());
|
||||
Assert.Equal (string.Empty, Application.ForceDriver);
|
||||
|
||||
Assert.Throws<InvalidOperationException> (() => Application.ForceDriver = "dotnet");
|
||||
|
||||
Application.ForceDriver = "fake";
|
||||
Assert.Equal ("fake", Application.ForceDriver);
|
||||
}
|
||||
}
|
||||
@@ -2,42 +2,4 @@
|
||||
|
||||
namespace UnitTests_Parallelizable.DriverTests;
|
||||
|
||||
public class DriverTests : FakeDriverBase
|
||||
{
|
||||
[Fact]
|
||||
public void ForceDriver_Does_Not_Changes_If_It_Has_Valid_Value ()
|
||||
{
|
||||
IDriver driver = CreateFakeDriver ();
|
||||
|
||||
Assert.False (Application.Initialized);
|
||||
Assert.Null (Application.Driver);
|
||||
Assert.Equal (string.Empty, Application.ForceDriver);
|
||||
|
||||
Application.ForceDriver = "fake";
|
||||
Assert.Equal ("fake", Application.ForceDriver);
|
||||
|
||||
Application.ForceDriver = "dotnet";
|
||||
Assert.Equal ("fake", Application.ForceDriver);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ForceDriver_Throws_If_Initialized_Changed_To_Another_Value ()
|
||||
{
|
||||
IDriver driver = CreateFakeDriver ();
|
||||
|
||||
Assert.False (Application.Initialized);
|
||||
Assert.Null (Application.Driver);
|
||||
Assert.Equal (string.Empty, Application.ForceDriver);
|
||||
|
||||
Application.Init (driver);
|
||||
Assert.True (Application.Initialized);
|
||||
Assert.NotNull (Application.Driver);
|
||||
Assert.Equal ("fake", Application.Driver.GetName ());
|
||||
Assert.Equal (string.Empty, Application.ForceDriver);
|
||||
|
||||
Assert.Throws<InvalidOperationException> (() => Application.ForceDriver = "dotnet");
|
||||
|
||||
Application.ForceDriver = "fake";
|
||||
Assert.Equal ("fake", Application.ForceDriver);
|
||||
}
|
||||
}
|
||||
public class DriverTests : FakeDriverBase { }
|
||||
|
||||
Reference in New Issue
Block a user