hedgehogqa / hedgehogqa/fsharp-hedgehog
Add csharp complex generator example
- Dominant language
- F#
- Stars
- 284
- Forks
- 31
- PR merge metrics
- No merged PRs in 30d
Description
In tutorial we have sample for genarator of IpAddress
```fsharp
open System.Net
let ipAddressGen : Gen = gen {
let! addr = Range.constantBounded () |> Gen.byte |> Gen.array (Range.singleton 4)
return System.Net.IPAddress addr
}
```
Anybody could check my translation to csharp? It is'nt idiomatic csharp IMHO
```csharp
var byteRange = Range.ConstantBoundedByte();
var byteGen = Gen.Byte(byteRange);
var byteArrayGen = Hedgehog.Gen.array(Range.FromValue(4), byteGen);
var ipAddressGen = byteArrayGen.Select(bytes => new IPAddress(bytes));
```
May be it's suitable to add csharp.md with more examples?
Right now I try get how to use `Property.CounterExample`
Contributor guide
Assessment
This issue has not been assessed yet.