Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model-based testing examples in C#? #651

Open
baynezy opened this issue Dec 11, 2023 · 2 comments
Open

Model-based testing examples in C#? #651

baynezy opened this issue Dec 11, 2023 · 2 comments

Comments

@baynezy
Copy link

baynezy commented Dec 11, 2023

I have been using your library for property-based testing in my C# projects and I am pretty comfortable with that. However, I now have a complex cache that I have built and wanted to use model-based testing to exercise that to make sure I have any edge cases covered.

I have been looking at your documentation and I am struggling to get my head around it as I do not know F#.

Do you have any simple examples testing something like a Dictionary in C# available? I should be able to work it out from there.

I found this article, but as I do not understand the system under test I am struggling to follow the implementation.

@isberg
Copy link

isberg commented Jan 15, 2024

@baynezy I have seen several interesting youtube videos where John Hughes talks about Property-Based Testing and I am pretty sure he talks about model based testing as one specific strategy. The same is true also for Scott Wlaschin. Hopefully these will provide some guidance.

@kurtschelfthout
Copy link
Member

Hey, yes the docs leave much to be desired. That seems to be the general tune as I work through the backlog of issues!

Anyway, this may get you started: https://aaronstannard.com/fscheck-property-testing-csharp-part2/

There's also a hidden implementation of a model-based test for an Erlang-like process registry here: https://github.com/fscheck/FsCheck/blob/master/src/FsCheck/Script.fsx#L44 but it is F#.

If you get something working, please consider sending a PR to the docs...even if it's just a C# snippet we can put somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants