fscheck Questions

3

Solved

TL;DR: I'm not able to successfully use FsCheck with NUnit in C#: either: it tells me on stdout that the test failed but the test still appears green it tells me that it doesn't find any test to ...
Conti asked 15/11, 2017 at 16:25

1

Solved

I'm trying to implement a custom Arbitrary that generates glob syntax patterns like a*c?. I think my implementation is correct, it's just that, when running the test with Xunit, FsCheck doesn't see...
Karee asked 31/10, 2017 at 21:20

1

Solved

FsCheck has some neat default Arbitrary types to generate test data. However what if one of my test dates depends on another? For instance, consider the property of string.Substring() that a resul...
Soble asked 19/10, 2017 at 18:3

1

Solved

I'm trying to achieve the following behaviour with FsCheck: I'd like to create a generator that will generate a instance of MyUnion type, with every string field being non-null/empty. type MyNeste...
Bullet asked 15/8, 2017 at 13:49

2

Solved

I'm trying to learn how to use FsCheck properly, and integrating it with Expecto at the moment. I can get property tests to run if I'm using the default FsCheck config, but when I try to use my own...
Circassia asked 28/6, 2017 at 10:5

1

Solved

I originally tried to create a generator that have the first 5 elements fixed (and on any test using Prop.forAll the first five would always run), but failed in doing so. Now I am trying to simpli...
Gnarly asked 9/12, 2016 at 16:56

1

Solved

I thought it's time to try out FsCheck but it proves tougher than I thought. There's a lot of documentation on Arb, generators and so on, but there doesn't seem to be any guidance in how to apply t...
Llama asked 2/12, 2016 at 2:48

1

Solved

I'm playing with FsCheck so I have this implementation: let add a b = if a > 100 then failwith "nasty bug" else a + b ...and this FsCheck based test: fun (a:int) -> (add a 0) = a |&gt...
Sverige asked 14/11, 2016 at 14:36

3

I have a function to generate doubles in a range: let gen_doublein = fun mx mn -> Arb.generate<float> |> Gen.suchThat ( (>) mx ) |> Gen.suchThat ( (<) mn ) and then a func...
Ventilation asked 20/3, 2012 at 15:46

1

Solved

I would like to use the latest versions of NUnit, FsCheck, and F#. However, when I point to the latest versions of my packages, my unit tests do not get discovered. However, my property-based test...
Annabell asked 29/5, 2016 at 11:28

1

Solved

When implementing property-based testing, when should I use an input generator over a precondition expression? Are there performance considerations when selecting a particular option? Internally,...
Holliman asked 24/3, 2016 at 0:38

1

Solved

The Problem In F#, I am using FsCheck to generate an object (which I'm then using in an Xunit test, but I can recreate entirely outside of Xunit, so I think we can forget about Xunit). Running the...
Evaporate asked 10/3, 2016 at 17:34

1

Solved

Suppose I have an interface IPerson with 2 read properties age (int) and name (string). I also have a class Person implementing IPerson. How do I write a FsCheck generator for generating instance...
Alleman asked 4/2, 2016 at 14:11

3

Solved

I need generate unique non-null strings to be used as Dictionary keys. I tried something like: public static Gen<NonNull<string>> UniqueStrings() { return from s in Arb.Default.NonN...
Grimsley asked 15/1, 2016 at 6:12

3

Solved

I am a n00b to unit testing. I have installed FsCheck.Nunit and NUnitTestAdapter from Nuget, and I'm trying to do property-based-testing, largely inspired by the inestimable Scott Wlaschin. I am u...
Ackler asked 7/1, 2016 at 13:45

2

Solved

Let's say I'm writing some code for video analysis. Here is a simplified version of a Video class: public class Video { public readonly int Width; public readonly int Height; public readonly Li...
Cartan asked 27/9, 2015 at 18:23

1

Solved

I'd like to gradually integrate FsCheck in my C# test code (as first step). I'd like to randomly generate part of my input data. This is how I generate a random string: static string RandomStri...
Irrefutable asked 14/8, 2015 at 15:59

2

Solved

Consider a Discriminated Union: type DU = | Foo of string | Bar of int | Baz of decimal * float | Qux of bool I'd like to create a list of DU values with FsCheck, but I want none of the values t...
Regin asked 26/6, 2015 at 8:30

1

Solved

Is there a way to generate a string in FsCheck by selecting just one item from each of a list of strings and then concatenating the result? I'm just completely stuck and can't seem to figure it o...
Assay asked 1/3, 2015 at 19:8

2

Solved

I want to integrate FsCheck tests with NUnit tests. Specifically, when I declare several FsCheck properties, I want them to be visible and runnable from the VS runner. I have found the following de...
Esau asked 30/7, 2012 at 11:45

0

I have just started working with FsCheck and have been writing some simple tests. However I keep coming across an issue which causes Xunit to throw an exception which then kills the VS2012 test run...
Troopship asked 14/4, 2014 at 8:6

2

Solved

I've got a type Average with a field count that's a positive int64 and a double field called sum. I made an arbitrary that generates valid instances with let AverageGen = Gen.map2 (fun s c ->...
Destitution asked 28/3, 2014 at 17:30

2

Solved

We want to use FsCheck as part of our unit testing in continuous integration. As such deterministic and reproducible behaviour is very important for us. FsCheck, being a random testing framework, ...
Fina asked 3/3, 2014 at 11:14

2

Solved

I'd like to create an FsCheck Generator to generate instances of a "complex" object. By complex, I mean an existing class in C# that has a number of child properties and collections. These properti...
Gluttonize asked 24/2, 2014 at 12:39

2

Solved

In F#, I have a record with a few fields: type myRecord = { a:float; b:float; c:float } I am using FsCheck to test some properties which use this record. For (a contrived) example, let verify...
Hermilahermina asked 16/11, 2011 at 23:53

© 2022 - 2024 — McMap. All rights reserved.