From d222d686f081cb1a49e0f367f4ad29bddef8ea28 Mon Sep 17 00:00:00 2001 From: AN Date: Fri, 30 Jun 2023 13:46:38 -0500 Subject: [PATCH] polish 1 --- .../csharp-examples/DocumentationSamples.cs | 8 ++-- .../csharp-examples/csharp-examples.csproj | 6 +-- .../fsharp-examples/fsharp-examples.fsproj | 10 +++-- readmeCSharp.md | 8 ++-- tests/Hedgehog.Xunit.CSharp.Tests/Async.cs | 37 ++++++++----------- .../Hedgehog.Xunit.CSharp.Tests.csproj | 7 ++-- tests/Hedgehog.Xunit.Tests/PropertyTests.fs | 4 +- 7 files changed, 39 insertions(+), 41 deletions(-) diff --git a/examples/csharp-examples/DocumentationSamples.cs b/examples/csharp-examples/DocumentationSamples.cs index 00181f5..1524d67 100644 --- a/examples/csharp-examples/DocumentationSamples.cs +++ b/examples/csharp-examples/DocumentationSamples.cs @@ -1,4 +1,4 @@ -using Hedgehog; +using Hedgehog; using Hedgehog.Linq; using Hedgehog.Xunit; using Microsoft.FSharp.Core; @@ -87,7 +87,7 @@ public static AutoGenConfig _( public bool This_also_passes(string s, int i) => s == "foo" && i == 13; - internal static Task Fast() + internal static Task FooAsync() { return Task.CompletedTask; } @@ -96,7 +96,7 @@ internal static Task Fast() public async Task Async_Task_property( int i) { - await Fast(); + await FooAsync(); Assert.True(i == i); } @@ -111,7 +111,7 @@ public Task Task_property( [Property] public async Task Async_boolean(bool i) { - await Fast(); + await FooAsync(); return i || !i; } diff --git a/examples/csharp-examples/csharp-examples.csproj b/examples/csharp-examples/csharp-examples.csproj index 381db0f..095abe6 100644 --- a/examples/csharp-examples/csharp-examples.csproj +++ b/examples/csharp-examples/csharp-examples.csproj @@ -1,7 +1,7 @@ - net6 + net6.0 csharp_examples enable enable @@ -10,13 +10,13 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/examples/fsharp-examples/fsharp-examples.fsproj b/examples/fsharp-examples/fsharp-examples.fsproj index ec461fb..3934041 100644 --- a/examples/fsharp-examples/fsharp-examples.fsproj +++ b/examples/fsharp-examples/fsharp-examples.fsproj @@ -1,7 +1,7 @@ - net6 + net6.0 fsharp_examples false @@ -13,13 +13,13 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all @@ -29,4 +29,8 @@ + + + + diff --git a/readmeCSharp.md b/readmeCSharp.md index 817e0b6..2eaf7a6 100644 --- a/readmeCSharp.md +++ b/readmeCSharp.md @@ -108,7 +108,7 @@ Rerun a particular test case. * Async and not async `Task` are also considered properties ```CSharp - internal static Task Fast() + internal static Task FooAsync() { return Task.CompletedTask; } @@ -116,7 +116,7 @@ Rerun a particular test case. [Property] public async Task Async_boolean(bool i) { - await Fast(); + await FooAsync(); return i || !i; } @@ -147,7 +147,7 @@ Rerun a particular test case. * If the property returns task it is considered a property and should throw an exception if the test fails ```CSharp - internal static Task Fast() + internal static Task FooAsync() { return Task.CompletedTask; } @@ -156,7 +156,7 @@ Rerun a particular test case. public async Task Async_Task_property( int i) { - await Fast(); + await FooAsync(); Assert.True(i == i); } diff --git a/tests/Hedgehog.Xunit.CSharp.Tests/Async.cs b/tests/Hedgehog.Xunit.CSharp.Tests/Async.cs index 563d096..15c7360 100644 --- a/tests/Hedgehog.Xunit.CSharp.Tests/Async.cs +++ b/tests/Hedgehog.Xunit.CSharp.Tests/Async.cs @@ -1,27 +1,22 @@ -using System.Threading.Tasks.Sources; -using Hedgehog.Linq; - -namespace Hedgehog.Xunit.CSharp.Tests; +namespace Hedgehog.Xunit.CSharp.Tests; public class Async { - internal static Task Fast() - { - return Task.CompletedTask; - } + internal static Task FooAsync() => Task.CompletedTask; - [Property] - public async Task Async_property_which_returns_task_can_run( - int i) - { - await Fast(); - Assert.True(i == i); - } + [Property] + public async Task Async_property_which_returns_task_can_run( + int i) + { + await FooAsync(); + Assert.True(i == i); + } - [Property] - public async Task Async_property_which_returns_boolean_task_can_run(bool i) - { - await Fast(); - return i || !i; - } + [Property] + public async Task Async_property_which_returns_boolean_task_can_run( + bool i) + { + await FooAsync(); + return i || !i; + } } diff --git a/tests/Hedgehog.Xunit.CSharp.Tests/Hedgehog.Xunit.CSharp.Tests.csproj b/tests/Hedgehog.Xunit.CSharp.Tests/Hedgehog.Xunit.CSharp.Tests.csproj index cba8627..bb68282 100644 --- a/tests/Hedgehog.Xunit.CSharp.Tests/Hedgehog.Xunit.CSharp.Tests.csproj +++ b/tests/Hedgehog.Xunit.CSharp.Tests/Hedgehog.Xunit.CSharp.Tests.csproj @@ -1,8 +1,7 @@ - net6 - net7.0 + net6.0 enable enable @@ -11,13 +10,13 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/tests/Hedgehog.Xunit.Tests/PropertyTests.fs b/tests/Hedgehog.Xunit.Tests/PropertyTests.fs index 0d837f0..68bf7f0 100644 --- a/tests/Hedgehog.Xunit.Tests/PropertyTests.fs +++ b/tests/Hedgehog.Xunit.Tests/PropertyTests.fs @@ -342,7 +342,7 @@ module ``Asynchronous tests`` = | _ -> failwith "impossible" open System.Threading.Tasks - let Fast() = + let FooAsync() = Task.CompletedTask [] @@ -358,7 +358,7 @@ module ``Asynchronous tests`` = [] let ``TaskBuilder (returning Task) with exception shrinks, skipped`` (i: int) : Task = task { - do! Fast() + do! FooAsync() if i > 10 then raise <| Exception() }