ConsoleScrolllingTests.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using Xunit.Abstractions;
  2. // Alias Console to MockConsole so we don't accidentally use Console
  3. using Console = Terminal.Gui.Drivers.FakeConsole;
  4. namespace UnitTests.DriverTests;
  5. public class ConsoleScrollingTests
  6. {
  7. private readonly ITestOutputHelper output;
  8. public ConsoleScrollingTests (ITestOutputHelper output)
  9. {
  10. ConsoleDriver.RunningUnitTests = true;
  11. this.output = output;
  12. }
  13. [Theory]
  14. [InlineData (typeof (FakeDriver))]
  15. ////[InlineData (typeof (DotNetDriver))]
  16. //[InlineData (typeof (ANSIDriver))]
  17. ////[InlineData (typeof (WindowsDriver))]
  18. ////[InlineData (typeof (UnixDriver))]
  19. public void Left_And_Top_Is_Always_Zero (Type driverType)
  20. {
  21. var driver = (FakeDriver)Activator.CreateInstance (driverType);
  22. Application.Init (driver);
  23. Assert.Equal (0, Console.WindowLeft);
  24. Assert.Equal (0, Console.WindowTop);
  25. driver.SetWindowPosition (5, 5);
  26. Assert.Equal (0, Console.WindowLeft);
  27. Assert.Equal (0, Console.WindowTop);
  28. Application.Shutdown ();
  29. }
  30. }