<Project>

  <!-- Inherit everything from the repo root, then relax and add what test projects need. -->
  <Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />

  <PropertyGroup>
    <IsPackable>false</IsPackable>
    <IsTestProject>true</IsTestProject>
    <!-- Test projects legitimately do things production code should not: assert on
         nulls, construct throwaway objects, use reflection. Keep warnings visible
         but non-fatal so a test file never blocks a build. -->
    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
    <!-- xunit.v3 runs on Microsoft.Testing.Platform, which needs an executable host. -->
    <OutputType>Exe</OutputType>
    <UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
    <TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
  </PropertyGroup>

  <PropertyGroup Label="Analyzer relaxations for tests">
    <!-- CA1707: test method names use underscores by convention (Method_State_Expectation).
         CA2007: no SynchronizationContext in tests, ConfigureAwait is noise.
         CA1861: inline constant arrays in theories are clearer than static fields. -->
    <!--
      MA0004 is the Meziantou equivalent of CA2007: there is no SynchronizationContext under
      the test host, so ConfigureAwait is noise.
      xUnit1051 wants TestContext.Current.CancellationToken threaded through every awaited
      call. Worth doing for long-running suites; here the container fixture owns lifetime and
      the assertions are short, so it buys nothing but churn.
    -->
    <NoWarn>$(NoWarn);CA1707;CA2007;CA1861;CA1052;CA1515;MA0004;xUnit1051</NoWarn>
  </PropertyGroup>

  <ItemGroup Label="Test framework — every test project gets these">
    <PackageReference Include="xunit.v3" />
    <PackageReference Include="Shouldly" />
    <PackageReference Include="NSubstitute" />
  </ItemGroup>

  <ItemGroup>
    <Using Include="Xunit" />
    <Using Include="Shouldly" />
  </ItemGroup>

</Project>
