public static class CborPropertyTests
{
private const string? ReplaySeed = "(42,42)"; // set a seed for deterministic runs, null for randomized runs
- private const int MaxTests = 10_000;
+ private const int MaxTests = 100; // FsCheck default is 100
[Property(Replay = ReplaySeed, MaxTest = MaxTests, Arbitrary = new[] { typeof(CborRandomGenerators) })]
public static void Roundtrip_Int64(CborConformanceMode mode, long input)
}
[Property(Replay = ReplaySeed, MaxTest = MaxTests, Arbitrary = new[] { typeof(CborRandomGenerators) })]
- public static void PropertyTest_Roundtrip(CborPropertyTestContext input)
+ public static void CborDocument_Roundtrip(CborPropertyTestContext input)
{
byte[] encoding = CborDocumentSerializer.encode(input);
}
[Property(Replay = ReplaySeed, MaxTest = MaxTests, Arbitrary = new[] { typeof(CborRandomGenerators) })]
- public static void PropertyTest_SkipValue(CborPropertyTestContext input)
+ public static void CborDocument_SkipValue(CborPropertyTestContext input)
{
int length = input.RootDocuments.Length;
input.RootDocuments = new[] { CborDocument.NewArray(_isDefiniteLength: true, input.RootDocuments) };
}
[Property(Replay = ReplaySeed, MaxTest = MaxTests, Arbitrary = new[] { typeof(CborRandomGenerators) })]
- public static void PropertyTest_SkipToParent(CborPropertyTestContext input)
+ public static void CborDocument_SkipToParent(CborPropertyTestContext input)
{
input.RootDocuments = new[] { CborDocument.NewArray(_isDefiniteLength: true, input.RootDocuments) };
byte[] encoding = CborDocumentSerializer.encode(input);
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
<nullable>enable</nullable>
- <CborPropertyTests>false</CborPropertyTests>
- </PropertyGroup>
-
- <PropertyGroup Condition="'$(CborPropertyTests)' == 'True'">
- <DefineConstants>$(DefineConstants),CBOR_PROPERTY_TESTS</DefineConstants>
<!-- Referenced assembly 'FsCheck' does not have a strong name.-->
<NoWarn>CS8002</NoWarn>
</PropertyGroup>
-
<ItemGroup>
<Compile Include="$(CommonTestPath)System\Security\Cryptography\ByteUtils.cs">
<Link>CommonTest\System\Security\Cryptography\ByteUtils.cs</Link>
</Compile>
+ <Compile Include="PropertyTests\CborPropertyTests.cs" />
+ <Compile Include="PropertyTests\CborRandomGenerators.cs" />
<Compile Include="Reader\CborReaderTests.cs" />
<Compile Include="Reader\CborReaderTests.ByteString.cs" />
<Compile Include="Reader\CborReaderTests.TextString.cs" />
<Compile Include="Writer\CborWriterTests.TextString.cs" />
<Compile Include="CoseKeyHelpers.cs" />
</ItemGroup>
-
- <ItemGroup Condition="'$(CborPropertyTests)' == 'True'">
- <Compile Include="PropertyTests\CborPropertyTests.cs" />
- <Compile Include="PropertyTests\CborRandomGenerators.cs" />
- </ItemGroup>
-
+
<ItemGroup>
<ProjectReference Include="..\src\System.Formats.Cbor.csproj" />
- </ItemGroup>
-
- <ItemGroup Condition="'$(CborPropertyTests)' == 'True'">
<ProjectReference Include="CborDocument\System.Formats.Cbor.Tests.DataModel.fsproj" />
+ <PackageReference Include="FsCheck" Version="$(FsCheckVersion)" />
<PackageReference Include="FsCheck.Xunit" Version="$(FsCheckVersion)" />
</ItemGroup>
</Project>