Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
dharmaturtle committed Jun 30, 2023
1 parent d222d68 commit c45ba46
Show file tree
Hide file tree
Showing 18 changed files with 63 additions and 60 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,18 @@ jobs:
uses: actions/setup-dotnet@v3
- name: Build
run: dotnet build -c Release "src/Hedgehog.Xunit"
- name: Test
run: dotnet test -c Release "tests/Hedgehog.Xunit.Tests" /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov
- name: Test F#
run: dotnet test -c Release "tests/Hedgehog.Xunit.Tests.FSharp" /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov
- name: Test C#
run: dotnet test -c Release "tests/Hedgehog.Xunit.Tests.CSharp"
- name: Run F# Examples
run: dotnet test -c Release "tests/Hedgehog.Xunit.Examples.FSharp"
- name: Run C# Examples
run: dotnet test -c Release "tests/Hedgehog.Xunit.Examples.CSharp"
- name: Coveralls
uses: coverallsapp/github-action@master
with:
path-to-lcov: tests/Hedgehog.Xunit.Tests/TestResults/coverage.info
path-to-lcov: tests/Hedgehog.Xunit.Tests.FSharp/TestResults/coverage.info
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish NuGet
uses: alirezanet/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
- name: Build
run: dotnet build -c Release "src/Hedgehog.Xunit"
- name: Test
run: dotnet test -c Release "tests/Hedgehog.Xunit.Tests" /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov
run: dotnet test -c Release "tests/Hedgehog.Xunit.Tests.FSharp" /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov
- name: Coveralls
uses: coverallsapp/github-action@master
with:
path-to-lcov: tests/Hedgehog.Xunit.Tests/TestResults/coverage.info
path-to-lcov: tests/Hedgehog.Xunit.Tests.FSharp/TestResults/coverage.info
github-token: ${{ secrets.GITHUB_TOKEN }}
39 changes: 19 additions & 20 deletions Hedgehog.Xunit.sln
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31612.314
MinimumVisualStudioVersion = 10.0.40219.1
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Hedgehog.Xunit", "src\Hedgehog.Xunit\Hedgehog.Xunit.fsproj", "{216BE9A2-7DCC-445F-8438-B138D8CB1FE8}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Hedgehog.Xunit.Tests", "tests\Hedgehog.Xunit.Tests\Hedgehog.Xunit.Tests.fsproj", "{63A8D184-519E-4061-8A74-F1EACAF3B0D5}"
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Hedgehog.Xunit.Tests.FSharp", "tests\Hedgehog.Xunit.Tests.FSharp\Hedgehog.Xunit.Tests.FSharp.fsproj", "{63A8D184-519E-4061-8A74-F1EACAF3B0D5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hedgehog.Xunit.Tests.CSharp", "tests\Hedgehog.Xunit.Tests.CSharp\Hedgehog.Xunit.Tests.CSharp.csproj", "{FD0E6589-BB1A-4A0D-B5C0-E3F2C360C16D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hedgehog.Xunit.Examples.CSharp", "examples\Hedgehog.Xunit.Examples.CSharp\Hedgehog.Xunit.Examples.CSharp.csproj", "{28392E14-0B8D-425A-B732-CF1FEF2B3078}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Hedgehog.Xunit.Examples.FSharp", "examples\Hedgehog.Xunit.Examples.FSharp\Hedgehog.Xunit.Examples.FSharp.fsproj", "{9772F0D9-76F0-4ABE-A795-D901638A0684}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E5FCE96F-A6AE-434F-B901-19359F39B504}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -14,12 +19,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
readmeCSharp.md = readmeCSharp.md
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "csharp-examples", "examples\csharp-examples\csharp-examples.csproj", "{601273CF-7FBF-4263-9EC4-8206CFDF6DC8}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fsharp-examples", "examples\fsharp-examples\fsharp-examples.fsproj", "{7F2616F0-500D-488F-A2BC-B4D6D4833DE1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hedgehog.Xunit.CSharp.Tests", "tests\Hedgehog.Xunit.CSharp.Tests\Hedgehog.Xunit.CSharp.Tests.csproj", "{FADA4F4C-8FAB-49CB-900C-7321910433DB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -34,18 +33,18 @@ Global
{63A8D184-519E-4061-8A74-F1EACAF3B0D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63A8D184-519E-4061-8A74-F1EACAF3B0D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63A8D184-519E-4061-8A74-F1EACAF3B0D5}.Release|Any CPU.Build.0 = Release|Any CPU
{601273CF-7FBF-4263-9EC4-8206CFDF6DC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{601273CF-7FBF-4263-9EC4-8206CFDF6DC8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{601273CF-7FBF-4263-9EC4-8206CFDF6DC8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{601273CF-7FBF-4263-9EC4-8206CFDF6DC8}.Release|Any CPU.Build.0 = Release|Any CPU
{7F2616F0-500D-488F-A2BC-B4D6D4833DE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7F2616F0-500D-488F-A2BC-B4D6D4833DE1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7F2616F0-500D-488F-A2BC-B4D6D4833DE1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7F2616F0-500D-488F-A2BC-B4D6D4833DE1}.Release|Any CPU.Build.0 = Release|Any CPU
{FADA4F4C-8FAB-49CB-900C-7321910433DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FADA4F4C-8FAB-49CB-900C-7321910433DB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FADA4F4C-8FAB-49CB-900C-7321910433DB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FADA4F4C-8FAB-49CB-900C-7321910433DB}.Release|Any CPU.Build.0 = Release|Any CPU
{FD0E6589-BB1A-4A0D-B5C0-E3F2C360C16D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FD0E6589-BB1A-4A0D-B5C0-E3F2C360C16D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FD0E6589-BB1A-4A0D-B5C0-E3F2C360C16D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FD0E6589-BB1A-4A0D-B5C0-E3F2C360C16D}.Release|Any CPU.Build.0 = Release|Any CPU
{28392E14-0B8D-425A-B732-CF1FEF2B3078}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{28392E14-0B8D-425A-B732-CF1FEF2B3078}.Debug|Any CPU.Build.0 = Debug|Any CPU
{28392E14-0B8D-425A-B732-CF1FEF2B3078}.Release|Any CPU.ActiveCfg = Release|Any CPU
{28392E14-0B8D-425A-B732-CF1FEF2B3078}.Release|Any CPU.Build.0 = Release|Any CPU
{9772F0D9-76F0-4ABE-A795-D901638A0684}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9772F0D9-76F0-4ABE-A795-D901638A0684}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9772F0D9-76F0-4ABE-A795-D901638A0684}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9772F0D9-76F0-4ABE-A795-D901638A0684}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
namespace Hedgehog.Xunit.Examples.CSharp;

using global::Xunit.Abstractions;
using Hedgehog;
using Hedgehog.Linq;
using Hedgehog.Xunit;
using Microsoft.FSharp.Core;
using Xunit.Abstractions;
using static Hedgehog.Linq.Property;
using Gen = Hedgehog.Linq.Gen;
using Range = Hedgehog.Linq.Range;

namespace csharp_examples;
using Gen = Linq.Gen;
using Range = Linq.Range;

public class DocumentationSamples
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Hedgehog;
namespace Hedgehog.Xunit.Examples.CSharp.GenAttributeVsContainer;

using Hedgehog;
using Hedgehog.Linq;
using Hedgehog.Xunit;
using Gen = Hedgehog.Linq.Gen;
using Range = Hedgehog.Linq.Range;

namespace csharp_examples.attribute_based_parameter_comparison;
using Gen = Linq.Gen;
using Range = Linq.Range;

public record PositiveInt(int Value);
public record NegativeInt(int Value);
Expand All @@ -24,7 +24,7 @@ from i in Gen.Int32(Range.Constant(int.MinValue, -1))
.WithGenerator(GenNegativeInt);
}

public class PositiveAndNegativeGeneratorContainerTypes
public class Container
{
[Property(typeof(Generators))]
public bool ResultOfAddingPositiveAndNegativeLessThanPositive(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Hedgehog;
using Hedgehog.Xunit;
using Gen = Hedgehog.Linq.Gen;
using Range = Hedgehog.Linq.Range;
namespace Hedgehog.Xunit.Examples.CSharp.GenAttributeVsContainer;

namespace csharp_examples.attribute_based_parameter_comparison;
using Hedgehog;
using Hedgehog.Xunit;
using Gen = Linq.Gen;
using Range = Linq.Range;

public class Negative : GenAttribute<int>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Hedgehog;
using Hedgehog.Xunit;
using Gen = Hedgehog.Linq.Gen;
using Range = Hedgehog.Linq.Range;
namespace Hedgehog.Xunit.Examples.CSharp.GenAttributeVsContainer;

namespace csharp_examples.attribute_based_parameter_comparison;
using Hedgehog;
using Hedgehog.Xunit;
using Gen = Linq.Gen;
using Range = Linq.Range;

public class Int32Range : GenAttribute<int>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>csharp_examples</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module attribute_based_parameter_comparison
module GenAttributeVsContainer

open Hedgehog
open Hedgehog.Xunit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>fsharp_examples</RootNamespace>

<IsPackable>false</IsPackable>
<GenerateProgramFile>false</GenerateProgramFile>
</PropertyGroup>

<ItemGroup>
<Compile Include="attribute-based-parameter-comparison.fs" />
<Compile Include="GenAttributeVsContainer.fs" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions readmeCSharp.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Allows the easy configuration of all properties in a test suite.
Rerun a particular test case.
* [GenAttribute](#GenAttribute) Control what generator is used on a parameter by parameter basis. configure

> All code in the below is available [here](/examples/csharp-examples/DocumentationSamples.cs)
> All code in the below is available [here](/examples/Hedgehog.Xunit.Examples.CSharp/DocumentationSamples.cs)
### `Property` attribute
---
Expand Down Expand Up @@ -262,7 +262,7 @@ public bool this_passes_now(int i) =>
This is the base type of an attribute that can applied property function arguments. It allows you to provide a generator on a parameter by parameter basis.

Lets look at the a property where we want to specify the generator to be used for two integer arguments.
Using a `Property` attribute on this turns out to be quite tricky as we require two different generators for the same type, we may end up with something like [this](/examples/csharp-examples/attribute-based-parameter-comparison/PositiveAndNegativeGeneratorContainerTypes.cs).
Using a `Property` attribute on this turns out to be quite tricky as we require two different generators for the same type, we may end up with something like [this](/examples/Hedgehog.Xunit.Examples.CSharp/attribute-based-parameter-comparison/PositiveAndNegativeGeneratorContainerTypes.cs).


```CSharp
Expand Down Expand Up @@ -295,7 +295,7 @@ public class PositiveAndNegativeGeneratorContainerTypes
}
```

Using the `GenAttribute` attribute is would look like [this](/examples//csharp-examples//attribute-based-parameter-comparison/PositiveAndNegativeSimpleAttribute.cs):
Using the `GenAttribute` attribute is would look like [this](/examples/Hedgehog.Xunit.Examples.CSharp/attribute-based-parameter-comparison/PositiveAndNegativeSimpleAttribute.cs):

```CSharp
public class Negative : GenAttribute<int>
Expand All @@ -317,7 +317,7 @@ public class PositiveAndNegativeUtilizingIntegerRangeAttribute
}
```

We can also supply parameters to the generator like [so](/examples/csharp-examples/attribute-based-parameter-comparison/PositiveAndNegativeUtilizingIntegerRangeAttribute.cs):
We can also supply parameters to the generator like [so](/examples/Hedgehog.Xunit.Examples.CSharp/attribute-based-parameter-comparison/PositiveAndNegativeUtilizingIntegerRangeAttribute.cs):

```F#
//Using a parameterised attribute to configure the generators
Expand Down
4 changes: 2 additions & 2 deletions src/Hedgehog.Xunit/Hedgehog.Xunit.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<IsPackable>true</IsPackable>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
Expand Down Expand Up @@ -44,7 +44,7 @@ Docs at https://github.com/dharmaturtle/fsharp-hedgehog-xunit

<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>$(AssemblyName).Tests</_Parameter1>
<_Parameter1>$(AssemblyName).Tests.FSharp</_Parameter1>
</AssemblyAttribute>
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Hedgehog.Xunit.CSharp.Tests;
namespace Hedgehog.Xunit.Tests.CSharp;

public class Async
{
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Hedgehog.Xunit.Tests
namespace Hedgehog.Xunit.Tests.FSharp

open Xunit
open System
Expand Down Expand Up @@ -221,7 +221,7 @@ module ``Property module with AutoGenConfig tests`` =
let ``Instance property fails`` () =
let testMethod = typeof<Marker>.DeclaringType.GetMethod(nameof ``Instance property fails, skipped``)
let e = Assert.Throws<Exception>(fun () -> InternalLogic.parseAttributes testMethod typeof<Marker>.DeclaringType |> ignore)
Assert.Equal("Hedgehog.Xunit.Tests.Property module with AutoGenConfig tests+FailingTests+NonstaticProperty must have exactly one public static property that returns an AutoGenConfig.
Assert.Equal("Hedgehog.Xunit.Tests.FSharp.Property module with AutoGenConfig tests+FailingTests+NonstaticProperty must have exactly one public static property that returns an AutoGenConfig.
An example type definition:
Expand All @@ -237,7 +237,7 @@ type NonstaticProperty =
let ``Non AutoGenConfig static property fails`` () =
let testMethod = typeof<Marker>.DeclaringType.GetMethod(nameof ``Non AutoGenConfig static property fails, skipped``)
let e = Assert.Throws<Exception>(fun () -> InternalLogic.parseAttributes testMethod typeof<Marker>.DeclaringType |> ignore)
Assert.Equal("Hedgehog.Xunit.Tests.Property module with AutoGenConfig tests+FailingTests+NonAutoGenConfig must have exactly one public static property that returns an AutoGenConfig.
Assert.Equal("Hedgehog.Xunit.Tests.FSharp.Property module with AutoGenConfig tests+FailingTests+NonAutoGenConfig must have exactly one public static property that returns an AutoGenConfig.
An example type definition:
Expand Down

0 comments on commit c45ba46

Please sign in to comment.