Skip to content

Commit 391fec8

Browse files
committed
Refactor project testing utilities and enhance test structure
- Introduced `TestUtils` module to encapsulate common testing functions and utilities. - Updated `TestAssetProjInfo2` to include new expectations for graph and project results. - Refactored existing tests to utilize the new `TestUtils` functions for better readability and maintainability. - Replaced inline error handling and logging with structured approaches in tests. - Ensured all tests now conform to the new expectations for project options, graph results, and project results.
1 parent 18b67b3 commit 391fec8

File tree

5 files changed

+807
-981
lines changed

5 files changed

+807
-981
lines changed

test/Ionide.ProjInfo.Tests/Ionide.ProjInfo.Tests.fsproj

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,21 @@
1111
<ItemGroup>
1212
<Compile Include="FileUtils.fs" />
1313
<Compile Include="TestAssets.fs" />
14+
<Compile Include="TestUtils.fs" />
15+
<Compile Include="ProjectLoader2Tests.fs" />
1416
<Compile Include="Tests.fs" />
1517
<Compile Include="Program.fs" />
1618
</ItemGroup>
1719
<ItemGroup>
1820
<ProjectReference Include="..\..\src\Ionide.ProjInfo\Ionide.ProjInfo.fsproj" />
1921
<ProjectReference Include="..\..\src\Ionide.ProjInfo.FCS\Ionide.ProjInfo.FCS.fsproj" />
20-
<ProjectReference
21-
Include="..\..\src\Ionide.ProjInfo.ProjectSystem\Ionide.ProjInfo.ProjectSystem.fsproj" />
22+
<ProjectReference Include="..\..\src\Ionide.ProjInfo.ProjectSystem\Ionide.ProjInfo.ProjectSystem.fsproj" />
2223
</ItemGroup>
23-
2424
<!-- This is a workaround for the test framework using Microsoft.Build dependencies and our
2525
project uses it's own set of Microsoft.Build dependencies which causes loading conflicts -->
26-
<Target
27-
Name="PostBuild"
28-
AfterTargets="PostBuildEvent">
29-
<Copy
30-
SourceFiles="$([System.IO.Directory]::GetParent($(BundledRuntimeIdentifierGraphFile)))\NuGet.Frameworks.dll"
31-
DestinationFolder="$(OutputPath)"
32-
ContinueOnError="false" />
26+
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
27+
<Copy SourceFiles="$([System.IO.Directory]::GetParent($(BundledRuntimeIdentifierGraphFile)))\NuGet.Frameworks.dll" DestinationFolder="$(OutputPath)" ContinueOnError="false" />
3328
</Target>
34-
3529
<ItemGroup>
3630
<PackageReference Include="Expecto" />
3731
<PackageReference Include="Expecto.Diff" />
@@ -43,21 +37,19 @@
4337
<PackageReference Include="Microsoft.Build.Framework" ExcludeAssets="runtime" IncludeAssets="compile" />
4438
<PackageReference Include="Microsoft.Build.Utilities.Core" ExcludeAssets="runtime" IncludeAssets="compile" />
4539
<PackageReference Include="Microsoft.Build.Tasks.Core" ExcludeAssets="runtime" IncludeAssets="compile" /> -->
46-
4740
</ItemGroup>
48-
4941
<ItemGroup>
50-
<Reference Include="Microsoft.Build">
51-
<HintPath>$(MSBuildBinPath)\Microsoft.Build.dll</HintPath>
52-
</Reference>
53-
<Reference Include="Microsoft.Build.Framework">
54-
<HintPath>$(MSBuildBinPath)\Microsoft.Build.Framework.dll</HintPath>
55-
</Reference>
56-
<Reference Include="Microsoft.Build.Utilities.Core">
57-
<HintPath>$(MSBuildBinPath)\Microsoft.Build.Utilities.Core.dll</HintPath>
58-
</Reference>
59-
<Reference Include="Microsoft.Build.Tasks.Core">
60-
<HintPath>$(MSBuildBinPath)\Microsoft.Build.Tasks.Core.dll</HintPath>
61-
</Reference>
62-
</ItemGroup>
63-
</Project>
42+
<Reference Include="Microsoft.Build">
43+
<HintPath>$(MSBuildBinPath)\Microsoft.Build.dll</HintPath>
44+
</Reference>
45+
<Reference Include="Microsoft.Build.Framework">
46+
<HintPath>$(MSBuildBinPath)\Microsoft.Build.Framework.dll</HintPath>
47+
</Reference>
48+
<Reference Include="Microsoft.Build.Utilities.Core">
49+
<HintPath>$(MSBuildBinPath)\Microsoft.Build.Utilities.Core.dll</HintPath>
50+
</Reference>
51+
<Reference Include="Microsoft.Build.Tasks.Core">
52+
<HintPath>$(MSBuildBinPath)\Microsoft.Build.Tasks.Core.dll</HintPath>
53+
</Reference>
54+
</ItemGroup>
55+
</Project>

0 commit comments

Comments
 (0)