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

Additional customizations out of the box #24

Open
egil opened this issue Aug 26, 2022 · 0 comments
Open

Additional customizations out of the box #24

egil opened this issue Aug 26, 2022 · 0 comments

Comments

@egil
Copy link

egil commented Aug 26, 2022

I have two customizations that could be useful to include in this library, I think:

  1. One that changes string generation to make it compatible with Verify (snapshot testing).
  2. One that ensures doubles always have a fraction when generated (could add similar ones for float and decimal).
// The split of the seed and the GUID makes it possible for Verify to detect the GUID and normalize it across tests.
fixture.Customize<string>(x => x.FromSeed(seed => $"{seed}_{Guid.NewGuid()}"));

// This ensures that double's have fraction part.
fixture.Customize<double>(c => c.FromFactory<int>(i => i * Math.PI));

Should we include these in ATC.Test?

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

No branches or pull requests

1 participant