Sfoglia il codice sorgente

Remove dependency on fluent assertions and fix folder paths

tznind 4 mesi fa
parent
commit
0b56a3d63b

+ 1 - 7
Terminal.sln

@@ -1,4 +1,4 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
+Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio Version 17
 # Visual Studio Version 17
 VisualStudioVersion = 17.2.32427.441
 VisualStudioVersion = 17.2.32427.441
 MinimumVisualStudioVersion = 10.0.40219.1
 MinimumVisualStudioVersion = 10.0.40219.1
@@ -62,8 +62,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StressTests", "Tests\Stress
 EndProject
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests.Parallelizable", "Tests\UnitTestsParallelizable\UnitTests.Parallelizable.csproj", "{DE780834-190A-8277-51FD-750CC666E82D}"
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTests.Parallelizable", "Tests\UnitTestsParallelizable\UnitTests.Parallelizable.csproj", "{DE780834-190A-8277-51FD-750CC666E82D}"
 EndProject
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TerminalGuiFluentTesting", "TerminalGuiFluentAssertions\TerminalGuiFluentTesting.csproj", "{7C610F03-9E38-409F-9B21-A02D5569E16A}"
-EndProject
 Global
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
 		Debug|Any CPU = Debug|Any CPU
@@ -118,10 +116,6 @@ Global
 		{DE780834-190A-8277-51FD-750CC666E82D}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{DE780834-190A-8277-51FD-750CC666E82D}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{DE780834-190A-8277-51FD-750CC666E82D}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{DE780834-190A-8277-51FD-750CC666E82D}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{DE780834-190A-8277-51FD-750CC666E82D}.Release|Any CPU.Build.0 = Release|Any CPU
 		{DE780834-190A-8277-51FD-750CC666E82D}.Release|Any CPU.Build.0 = Release|Any CPU
-		{7C610F03-9E38-409F-9B21-A02D5569E16A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{7C610F03-9E38-409F-9B21-A02D5569E16A}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{7C610F03-9E38-409F-9B21-A02D5569E16A}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{7C610F03-9E38-409F-9B21-A02D5569E16A}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 		HideSolutionNode = FALSE

+ 0 - 0
TerminalGuiFluentAssertions/ClassDiagram1.cd → TerminalGuiFluentTesting/ClassDiagram1.cd


+ 0 - 0
TerminalGuiFluentAssertions/FakeInput.cs → TerminalGuiFluentTesting/FakeInput.cs


+ 0 - 0
TerminalGuiFluentAssertions/FakeNetInput.cs → TerminalGuiFluentTesting/FakeNetInput.cs


+ 0 - 0
TerminalGuiFluentAssertions/FakeOutput.cs → TerminalGuiFluentTesting/FakeOutput.cs


+ 0 - 0
TerminalGuiFluentAssertions/FakeWindowsInput.cs → TerminalGuiFluentTesting/FakeWindowsInput.cs


+ 6 - 2
TerminalGuiFluentAssertions/GuiTestContext.cs → TerminalGuiFluentTesting/GuiTestContext.cs

@@ -1,4 +1,4 @@
-using FluentAssertions;
+
 using Terminal.Gui;
 using Terminal.Gui;
 using Terminal.Gui.ConsoleDrivers;
 using Terminal.Gui.ConsoleDrivers;
 
 
@@ -178,7 +178,11 @@ public class GuiTestContext<T> : IDisposable where T : Toplevel, new ()
         return this;
         return this;
     }
     }
 
 
-    public GuiTestContext<T> Assert<T2> (AndConstraint<T2> be) { return this; }
+    public GuiTestContext<T> Then (Action doAction)
+    {
+        doAction ();
+        return this;
+    }
 
 
     public GuiTestContext<T> RightClick (int screenX, int screenY) { return Click (WindowsConsole.ButtonState.Button3Pressed, screenX, screenY); }
     public GuiTestContext<T> RightClick (int screenX, int screenY) { return Click (WindowsConsole.ButtonState.Button3Pressed, screenX, screenY); }
 
 

+ 0 - 4
TerminalGuiFluentAssertions/TerminalGuiFluentTesting.csproj → TerminalGuiFluentTesting/TerminalGuiFluentTesting.csproj

@@ -6,10 +6,6 @@
     <Nullable>enable</Nullable>
     <Nullable>enable</Nullable>
   </PropertyGroup>
   </PropertyGroup>
 
 
-  <ItemGroup>
-    <PackageReference Include="FluentAssertions" />
-  </ItemGroup>
-
   <ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\Terminal.Gui\Terminal.Gui.csproj" />
     <ProjectReference Include="..\Terminal.Gui\Terminal.Gui.csproj" />
   </ItemGroup>
   </ItemGroup>

+ 0 - 0
TerminalGuiFluentAssertions/With.cs → TerminalGuiFluentTesting/With.cs


+ 5 - 9
Tests/UnitTests/FluentTests/BasicFluentAssertionTests.cs → Tests/IntegrationTests/FluentTests/BasicFluentAssertionTests.cs

@@ -1,13 +1,9 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using FluentAssertions;
+using System.Text;
+using Terminal.Gui;
 using TerminalGuiFluentTesting;
 using TerminalGuiFluentTesting;
 using Xunit.Abstractions;
 using Xunit.Abstractions;
 
 
-namespace UnitTests.FluentTests;
+namespace IntegrationTests.FluentTests;
 public class BasicFluentAssertionTests
 public class BasicFluentAssertionTests
 {
 {
     private readonly TextWriter _out;
     private readonly TextWriter _out;
@@ -53,9 +49,9 @@ public class BasicFluentAssertionTests
                                 };
                                 };
         using var c = With.A<Window> (40, 10)
         using var c = With.A<Window> (40, 10)
                           .Add (lbl )
                           .Add (lbl )
-                          .Assert (lbl.Frame.Width.Should().Be(38)) // Window has 2 border
+                          .Then (()=>Assert.Same(lbl.Frame.Width,38)) // Window has 2 border
                           .ResizeConsole (20,20)
                           .ResizeConsole (20,20)
-                          .Assert (lbl.Frame.Width.Should ().Be (18))
+                          .Then (() => Assert.Same (lbl.Frame.Width, 18))
                           .Stop ();
                           .Stop ();
     }
     }
 
 

+ 1 - 0
Tests/IntegrationTests/IntegrationTests.csproj

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

+ 0 - 1
Tests/UnitTests/UnitTests.csproj

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