Skip to content

Commit

Permalink
Untangle test utils refs (#3013)
Browse files Browse the repository at this point in the history
Provide a clear separation of layers. System.Windows.Forms.Primitives project contains "bare bone" implementations and imports. This project underpins System.Windows.Forms project which defines and implements higher level abstractions such as Application, Control, Form, etc.

Previously we had a shared test infra, that led to cross contamination of tests, e.g. passing higher level abstractions into tests for lower level abstractions.
  • Loading branch information
RussKie authored Jun 3, 2020
1 parent 2611b22 commit becb276
Show file tree
Hide file tree
Showing 51 changed files with 395 additions and 302 deletions.
25 changes: 16 additions & 9 deletions Winforms.sln
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28627.84
Expand Down Expand Up @@ -37,8 +37,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.Integr
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Drawing.Facade", "src\System.Drawing\src\System.Drawing.Facade.csproj", "{F1B0790A-1A40-4487-A607-36D21D827E44}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InternalUtilitiesForTests", "src\Common\tests\InternalUtilitiesForTests\InternalUtilitiesForTests.csproj", "{3603561D-907D-494B-9E3C-29D7001018F6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Accessibility", "src\Accessibility\src\Accessibility.ilproj", "{351D8601-6E21-45E8-B3B9-847C4540BD4E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Accessibility-version", "src\Accessibility\ver\Accessibility-version.csproj", "{6103E743-057D-41C6-946C-23A751A08748}"
Expand Down Expand Up @@ -117,7 +115,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MauiLabelTests", "src\Syste
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.Primitives", "src\System.Windows.Forms.Primitives\src\System.Windows.Forms.Primitives.csproj", "{90B27178-F535-43F7-886E-0AB75203F246}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.Primitives.Tests", "src\System.Windows.Forms.Primitives\tests\System.Windows.Forms.Primitives.Tests.csproj", "{9BFDE7F2-C8F3-40D6-9A16-8DCD1A37E900}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.Primitives.Tests", "src\System.Windows.Forms.Primitives\tests\UnitTests\System.Windows.Forms.Primitives.Tests.csproj", "{9BFDE7F2-C8F3-40D6-9A16-8DCD1A37E900}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4AA2764C-B013-40B5-9E5B-9459EF976C8B}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -130,6 +128,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MauiMonthCalendarTests", "s
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MauiTestsHelper", "src\System.Windows.Forms\tests\IntegrationTests\MauiTests\MauiTestsHelper\MauiTestsHelper.csproj", "{44BB1092-1844-4EAF-8DF5-338DE4C3149A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.Primitives.TestUtilities", "src\System.Windows.Forms.Primitives\tests\TestUtilities\System.Windows.Forms.Primitives.TestUtilities.csproj", "{73B0857A-966B-4E7D-8A83-FECFE0281AB9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Windows.Forms.TestUtilities", "src\System.Windows.Forms\tests\TestUtilities\System.Windows.Forms.TestUtilities.csproj", "{86418F0B-39DC-4B5A-8145-6D607E6150AC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -180,10 +182,6 @@ Global
{F1B0790A-1A40-4487-A607-36D21D827E44}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F1B0790A-1A40-4487-A607-36D21D827E44}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F1B0790A-1A40-4487-A607-36D21D827E44}.Release|Any CPU.Build.0 = Release|Any CPU
{3603561D-907D-494B-9E3C-29D7001018F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3603561D-907D-494B-9E3C-29D7001018F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3603561D-907D-494B-9E3C-29D7001018F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3603561D-907D-494B-9E3C-29D7001018F6}.Release|Any CPU.Build.0 = Release|Any CPU
{351D8601-6E21-45E8-B3B9-847C4540BD4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{351D8601-6E21-45E8-B3B9-847C4540BD4E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{351D8601-6E21-45E8-B3B9-847C4540BD4E}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -260,6 +258,14 @@ Global
{44BB1092-1844-4EAF-8DF5-338DE4C3149A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{44BB1092-1844-4EAF-8DF5-338DE4C3149A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{44BB1092-1844-4EAF-8DF5-338DE4C3149A}.Release|Any CPU.Build.0 = Release|Any CPU
{73B0857A-966B-4E7D-8A83-FECFE0281AB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{73B0857A-966B-4E7D-8A83-FECFE0281AB9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{73B0857A-966B-4E7D-8A83-FECFE0281AB9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{73B0857A-966B-4E7D-8A83-FECFE0281AB9}.Release|Any CPU.Build.0 = Release|Any CPU
{86418F0B-39DC-4B5A-8145-6D607E6150AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{86418F0B-39DC-4B5A-8145-6D607E6150AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{86418F0B-39DC-4B5A-8145-6D607E6150AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{86418F0B-39DC-4B5A-8145-6D607E6150AC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -278,7 +284,6 @@ Global
{680FB14C-7B0C-4D63-9F1A-18ACCDB0F52A} = {DF68A171-D27B-4E6A-8A7E-63A651622355}
{238195CE-7CCE-4469-ACD8-EA00E88D947A} = {680FB14C-7B0C-4D63-9F1A-18ACCDB0F52A}
{F1B0790A-1A40-4487-A607-36D21D827E44} = {434C00C3-E498-4BA7-9764-9F0FC8CFE457}
{3603561D-907D-494B-9E3C-29D7001018F6} = {DF68A171-D27B-4E6A-8A7E-63A651622355}
{351D8601-6E21-45E8-B3B9-847C4540BD4E} = {088DD24C-DF6B-45F3-A8BC-592580A4B2A9}
{6103E743-057D-41C6-946C-23A751A08748} = {088DD24C-DF6B-45F3-A8BC-592580A4B2A9}
{088DD24C-DF6B-45F3-A8BC-592580A4B2A9} = {77FEDB47-F7F6-490D-AF7C-ABB4A9E0B9D7}
Expand All @@ -301,6 +306,8 @@ Global
{E0681991-228A-420E-85D5-A9E796F0AAE0} = {434C00C3-E498-4BA7-9764-9F0FC8CFE457}
{9DDC6936-9197-4C09-8640-AF0BE4918700} = {8F20A905-BD37-4D80-B8DF-FA45276FC23F}
{44BB1092-1844-4EAF-8DF5-338DE4C3149A} = {8F20A905-BD37-4D80-B8DF-FA45276FC23F}
{73B0857A-966B-4E7D-8A83-FECFE0281AB9} = {DF68A171-D27B-4E6A-8A7E-63A651622355}
{86418F0B-39DC-4B5A-8145-6D607E6150AC} = {DF68A171-D27B-4E6A-8A7E-63A651622355}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7B1B0433-F612-4E5A-BE7E-FCF5B9F6E136}
Expand Down
7 changes: 0 additions & 7 deletions src/Common/tests/Directory.Build.props

This file was deleted.

111 changes: 0 additions & 111 deletions src/Common/tests/NoAssertContext.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<ItemGroup>
<ProjectReference Include="..\..\..\src\Microsoft.VisualBasic.Facade.csproj" />
<ProjectReference Include="..\..\..\..\Common\tests\InternalUtilitiesForTests\InternalUtilitiesForTests.csproj" />
<ProjectReference Include="..\..\..\..\System.Windows.Forms\tests\IntegrationTests\System.Windows.Forms.IntegrationTests.Common\System.Windows.Forms.IntegrationTests.Common.csproj" />
<ProjectReference Include="..\VisualBasicRuntimeTest\VisualBasicRuntimeTest.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,14 @@

<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="$(CoverletMSBuildPackageVersion)" />
<PackageReference Include="xunit.stafact" Version="$(XUnitStaFactPackageVersion)" />
<PackageReference Include="xunit.assert" Version="$(XUnitAssertVersion)" />
<PackageReference Include="Microsoft.DotNet.XUnitExtensions" Version="$(MicrosoftDotNetXUnitExtensionsPackageVersion)" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\System.Windows.Forms.Primitives\tests\TestUtilities\System.Windows.Forms.Primitives.TestUtilities.csproj" />
<ProjectReference Include="..\..\src\Microsoft.VisualBasic.Facade.csproj" />
<ProjectReference Include="..\..\..\Common\tests\InternalUtilitiesForTests\InternalUtilitiesForTests.csproj" />
</ItemGroup>

<ItemGroup>
<Compile Include="..\..\..\Common\tests\CommonMemberDataAttribute.cs" Link="Common\CommonMemberDataAttribute.cs" />
<Compile Include="..\..\..\Common\tests\CommonTestHelper.cs" Link="Common\CommonTestHelper.cs" />
<Compile Include="..\..\..\Common\tests\ThreadExceptionFixture.cs" Link="Common\ThreadExceptionFixture.cs" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\System.Windows.Forms\tests\TestUtilities\System.Windows.Forms.TestUtilities.csproj" />
<ProjectReference Include="..\..\src\System.Windows.Forms.Design.csproj" />
<ProjectReference Include="..\..\..\System.Design\src\System.Design.Facade.csproj" />
<ProjectReference Include="..\..\..\System.Drawing.Design\src\System.Drawing.Design.Facade.csproj" />
<ProjectReference Include="..\..\..\Common\tests\InternalUtilitiesForTests\InternalUtilitiesForTests.csproj" />
<Compile Include="..\..\..\Common\tests\CommonMemberDataAttribute.cs" Link="Common\CommonMemberDataAttribute.cs" />
<Compile Include="..\..\..\Common\tests\CommonTestHelper.cs" Link="Common\CommonTestHelper.cs" />
<Compile Include="..\..\..\Common\tests\ThreadExceptionFixture.cs" Link="Common\ThreadExceptionFixture.cs" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
[assembly: InternalsVisibleTo("System.Windows.Forms.Design, PublicKey=00000000000000000400000000000000")]
[assembly: InternalsVisibleTo("System.Windows.Forms.Design.Editors, PublicKey=00000000000000000400000000000000")]

[assembly: InternalsVisibleTo("System.Windows.Forms.Design.Tests, PublicKey=00000000000000000400000000000000")]
[assembly: InternalsVisibleTo("System.Windows.Forms.Primitives.Tests, PublicKey=00000000000000000400000000000000")]
[assembly: InternalsVisibleTo("System.Windows.Forms.Primitives.TestUtilities, PublicKey=00000000000000000400000000000000")]
[assembly: InternalsVisibleTo("System.Windows.Forms.Tests, PublicKey=00000000000000000400000000000000")]
[assembly: InternalsVisibleTo("System.Windows.Forms.Design.Tests, PublicKey=00000000000000000400000000000000")]
[assembly: InternalsVisibleTo("System.Windows.Forms.TestUtilities, PublicKey=00000000000000000400000000000000")]
[assembly: InternalsVisibleTo("WinformsControlsTest, PublicKey=00000000000000000400000000000000")]
[assembly: InternalsVisibleTo("InternalUtilitiesForTests, PublicKey=00000000000000000400000000000000")]
[assembly: InternalsVisibleTo("MauiListViewTests, PublicKey=00000000000000000400000000000000")]
[assembly: InternalsVisibleTo("System.Windows.Forms.IntegrationTests.Common, PublicKey=00000000000000000400000000000000")]
[assembly: InternalsVisibleTo("System.Windows.Forms.Maui.IntegrationTests, PublicKey=00000000000000000400000000000000")]
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>System.Windows.Forms.Primitives.TestUtilities</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<RootNamespace>System</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Moq" Version="$(MoqPackageVersion)" />
<PackageReference Include="System.Collections.Concurrent" Version="4.3.0" />
<PackageReference Include="xunit.stafact" Version="$(XUnitStaFactPackageVersion)" />
<PackageReference Include="xunit.assert" Version="$(XUnitAssertVersion)" />
<PackageReference Include="Microsoft.DotNet.XUnitExtensions" Version="$(MicrosoftDotNetXUnitExtensionsPackageVersion)" />
<PackageReference Include="Microsoft.Win32.Registry" Version="$(MicrosoftWin32RegistryPackageVersion)" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\System.Windows.Forms.Primitives.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace System.Windows.Forms.Tests.InteropTests
{
public class LVITEMWTests : IClassFixture<ThreadExceptionFixture>
public class LVITEMWTests
{
[Fact]
public unsafe void UpdateText_should_throw_AOOR_if_cchTextMax_less_than_1()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace System.Windows.Forms.Primitives.Tests.Interop.ComCtl32
{
public class MCGRIDINFOTests : IClassFixture<ThreadExceptionFixture>
public class MCGRIDINFOTests
{
[ConditionalFact(typeof(ArchitectureDetection), nameof(ArchitectureDetection.Is32bit))]
public unsafe void MCGRIDINFO_x32_Size()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace System.Windows.Forms.Primitives.Tests.Interop.ComCtl32
{
public class TASKDIALOGCONFIGIconUnionTests : IClassFixture<ThreadExceptionFixture>
public class TASKDIALOGCONFIGIconUnionTests
{
[ConditionalFact(typeof(ArchitectureDetection), nameof(ArchitectureDetection.Is32bit))]
public unsafe void TASKDIALOGCONFIGIconUnion_x32_Size()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace System.Windows.Forms.Primitives.Tests.Interop.ComCtl32
{
public class TASKDIALOGCONFIGTests : IClassFixture<ThreadExceptionFixture>
public class TASKDIALOGCONFIGTests
{
[ConditionalFact(typeof(ArchitectureDetection), nameof(ArchitectureDetection.Is32bit))]
public unsafe void TASKDIALOGCONFIG_x32_Size()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace System.Windows.Forms.Primitives.Tests.Interop.ComCtl32
{
public class TASKDIALOG_BUTTONTests : IClassFixture<ThreadExceptionFixture>
public class TASKDIALOG_BUTTONTests
{
[ConditionalFact(typeof(ArchitectureDetection), nameof(ArchitectureDetection.Is32bit))]
public unsafe void TASKDIALOG_BUTTON_x32_Size()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace System.Windows.Forms.Primitives.Tests.Interop.Comdlg32
{
public class PRINTDLGWTests : IClassFixture<ThreadExceptionFixture>
public class PRINTDLGWTests
{
[ConditionalFact(typeof(ArchitectureDetection), nameof(ArchitectureDetection.Is32bit))]
public unsafe void PRINTDLGW_32_Size()
Expand Down
Loading

0 comments on commit becb276

Please sign in to comment.