atc-net/atc-test

Additional customizations out of the box

Opened this issue · 0 comments

egil commented

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?