Investigate fluent assertions for testing v2

This commit is contained in:
tznind
2025-03-16 13:28:29 +00:00
committed by Tig
parent 8b5639e5e5
commit c511101dfe
7 changed files with 212 additions and 1 deletions

View File

@@ -6,7 +6,7 @@ using Moq;
namespace UnitTests.ConsoleDrivers.V2;
public class ApplicationV2Tests
{
private ApplicationV2 NewApplicationV2 ()
{
var netInput = new Mock<INetInput> ();

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TerminalGuiFluentAssertions;
namespace UnitTests.FluentTests;
public class BasicFluentAssertionTests
{
[Fact]
public void GuiTestContext_StartsAndStopsWithoutError ()
{
var context = With.A<Window> (40, 10);
// No actual assertions are needed — if no exceptions are thrown, it's working
context.Stop ();
}
[Fact]
public void Test ()
{
var myView = new TextField () { Width = 10 };
/*
using var ctx = With.A<Window> (20, 10)
.Add (myView, 3, 2)
.Focus (myView)
.Type ("Hello");
Assert.Equal ("Hello", myView.Text);*/
}
}

View File

@@ -45,6 +45,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Terminal.Gui\Terminal.Gui.csproj" />
<ProjectReference Include="..\..\TerminalGuiFluentAssertions\TerminalGuiFluentAssertions.csproj" />
<ProjectReference Include="..\..\UICatalog\UICatalog.csproj" />
</ItemGroup>
<ItemGroup>