예제 #1
0
        public static void Equal <T>(IGen <T> expected, IGen <T> actual, int seed, int?iterations = null)
        {
            var expectedSample = expected.Select(x => JsonConvert.SerializeObject(x)).Advanced.SampleExampleSpaces(seed: seed, iterations: iterations);
            var actualSample   = actual.Select(x => JsonConvert.SerializeObject(x)).Advanced.SampleExampleSpaces(seed: seed, iterations: iterations);

            Assert.All(
                Enumerable.Zip(expectedSample, actualSample),
                (x) =>
            {
                Assert.Equal(x.First.Sample(), x.Second.Sample());
            });
        }
예제 #2
0
 public static Property <T0> ForAll <T0>(IGen <T0> gen0, Func <T0, bool> func) =>
 new Property <T0>(
     gen0.Select(x => TestFactory.Create(
                     x,
                     () => func(x),
                     new object?[] { x })));