public static Arbitrary <SameCurrency <T> > Get <T>() where T : IEquatable <T> { var gen = from amount1 in AmountGenerators.All() from amount2 in AmountGenerators.All() from amount3 in AmountGenerators.All() from currency in Arb.Generate <T>() where currency != null select new SameCurrency <T>( Money.Create(amount1, currency), Money.Create(amount2, currency), Money.Create(amount3, currency)); return(Arb.From(gen, Shrinker)); }
public static Gen <Money <T> > Generator <T>() where T : IEquatable <T> => from amount in AmountGenerators.All() from currency in Arb.Generate <T>() select currency == null ? null : Money.Create(amount, currency);
public static Arbitrary <decimal> Get() => Arb.From( AmountGenerators.All(), Arb.Default.Decimal().Shrinker);