예제 #1
0
        public void ItPopulatesThePresentationalValueWithAScopedVariable()
        {
            var value = 0;

            var property =
                from a in Gen.Constant(value)
                select Property.ForThese(() => false);

            var result = property.Check();

            result.Counterexample !.PresentationalValue.Should().BeEquivalentTo(value);
        }
예제 #2
0
        public void ItPopulatesThePresentationalValueWithAScopedVariableAndIgnoresInnerSelectMany()
        {
            var value_ignored = 0;
            var value         = 1;

            var property =
                from a in Gen.Constant(value_ignored).SelectMany(_ => Gen.Constant(value))
                select Property.ForThese(() => false);

            var result = property.Check();

            result.Counterexample !.PresentationalValue.Should().BeEquivalentTo(value);
        }
예제 #3
0
        public void ItPopulatesThePresentationalValueWithTwoScopedVariables()
        {
            var value0 = 0;
            var value1 = 1;

            var property =
                from a in Gen.Constant(value0)
                from b in Gen.Constant(value1)
                select Property.ForThese(() => false);

            var result = property.Check();

            result.Counterexample !.PresentationalValue.Should().BeEquivalentTo(new [] { value0, value1 });
        }
예제 #4
0
            public void ItAllowsAnonymousObjectsToBeExplicitlyReturnedBySelectManyWithProjection()
            {
                // Ideally: { a = value, b = value }
                // Actual:  [value, value]

                var value = 0;

                var property =
                    from obj in Gen.Constant(value).SelectMany(a => Gen.Constant(new { a }), (x, y) => new { x, y })
                    select Property.ForThese(() => false);

                var result = property.Check(seed: 0);

                result.Counterexample !.PresentationalValue.Should().BeEquivalentTo(new[] { value, value });
            }