Skip to content

Commit 3651ba3

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 c7dba98 commit 3651ba3

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
@@ -12,27 +12,21 @@
1212
<ItemGroup>
1313
<Compile Include="FileUtils.fs" />
1414
<Compile Include="TestAssets.fs" />
15+
<Compile Include="TestUtils.fs" />
16+
<Compile Include="ProjectLoader2Tests.fs" />
1517
<Compile Include="Tests.fs" />
1618
<Compile Include="Program.fs" />
1719
</ItemGroup>
1820
<ItemGroup>
1921
<ProjectReference Include="..\..\src\Ionide.ProjInfo\Ionide.ProjInfo.fsproj" />
2022
<ProjectReference Include="..\..\src\Ionide.ProjInfo.FCS\Ionide.ProjInfo.FCS.fsproj" />
21-
<ProjectReference
22-
Include="..\..\src\Ionide.ProjInfo.ProjectSystem\Ionide.ProjInfo.ProjectSystem.fsproj" />
23+
<ProjectReference Include="..\..\src\Ionide.ProjInfo.ProjectSystem\Ionide.ProjInfo.ProjectSystem.fsproj" />
2324
</ItemGroup>
24-
2525
<!-- This is a workaround for the test framework using Microsoft.Build dependencies and our
2626
project uses it's own set of Microsoft.Build dependencies which causes loading conflicts -->
27-
<Target
28-
Name="PostBuild"
29-
AfterTargets="PostBuildEvent">
30-
<Copy
31-
SourceFiles="$([System.IO.Directory]::GetParent($(BundledRuntimeIdentifierGraphFile)))\NuGet.Frameworks.dll"
32-
DestinationFolder="$(OutputPath)"
33-
ContinueOnError="false" />
27+
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
28+
<Copy SourceFiles="$([System.IO.Directory]::GetParent($(BundledRuntimeIdentifierGraphFile)))\NuGet.Frameworks.dll" DestinationFolder="$(OutputPath)" ContinueOnError="false" />
3429
</Target>
35-
3630
<ItemGroup>
3731
<PackageReference Include="Expecto" />
3832
<PackageReference Include="Expecto.Diff" />
@@ -44,21 +38,19 @@
4438
<PackageReference Include="Microsoft.Build.Framework" ExcludeAssets="runtime" IncludeAssets="compile" />
4539
<PackageReference Include="Microsoft.Build.Utilities.Core" ExcludeAssets="runtime" IncludeAssets="compile" />
4640
<PackageReference Include="Microsoft.Build.Tasks.Core" ExcludeAssets="runtime" IncludeAssets="compile" /> -->
47-
4841
</ItemGroup>
49-
5042
<ItemGroup>
51-
<Reference Include="Microsoft.Build">
52-
<HintPath>$(MSBuildBinPath)\Microsoft.Build.dll</HintPath>
53-
</Reference>
54-
<Reference Include="Microsoft.Build.Framework">
55-
<HintPath>$(MSBuildBinPath)\Microsoft.Build.Framework.dll</HintPath>
56-
</Reference>
57-
<Reference Include="Microsoft.Build.Utilities.Core">
58-
<HintPath>$(MSBuildBinPath)\Microsoft.Build.Utilities.Core.dll</HintPath>
59-
</Reference>
60-
<Reference Include="Microsoft.Build.Tasks.Core">
61-
<HintPath>$(MSBuildBinPath)\Microsoft.Build.Tasks.Core.dll</HintPath>
62-
</Reference>
63-
</ItemGroup>
64-
</Project>
43+
<Reference Include="Microsoft.Build">
44+
<HintPath>$(MSBuildBinPath)\Microsoft.Build.dll</HintPath>
45+
</Reference>
46+
<Reference Include="Microsoft.Build.Framework">
47+
<HintPath>$(MSBuildBinPath)\Microsoft.Build.Framework.dll</HintPath>
48+
</Reference>
49+
<Reference Include="Microsoft.Build.Utilities.Core">
50+
<HintPath>$(MSBuildBinPath)\Microsoft.Build.Utilities.Core.dll</HintPath>
51+
</Reference>
52+
<Reference Include="Microsoft.Build.Tasks.Core">
53+
<HintPath>$(MSBuildBinPath)\Microsoft.Build.Tasks.Core.dll</HintPath>
54+
</Reference>
55+
</ItemGroup>
56+
</Project>

0 commit comments

Comments
 (0)