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); }
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); }
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 }); }
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 }); }