I am just starting with FsCheck and wanted to dig a little deeper, I have the following test case:
[Property]
public void some_test(HttpStatusCode httpStatusCode)
Now, I only want httpStatusCode
which are failures, how do I achieve that using FsCheck? I have the following code:
Prop.ForAll<HttpStatusCode>(code => new Func<bool>(() => !new HttpResponseMessage(code).IsSuccessStatusCode).When(true)).QuickCheck();
But have no idea how to hook that into the Property
attribute for my test case. Examples online are fairly convoluted for something so trivial. Any help or guidance will be appreciated.
Would be nice to have something like this but for custom objects and custom logic.
Cheers.