public Func <State, bool> Get(State state) { var info = StateInfo.Get(state); return((s) => { return Comparer.Compare(StateInfo.Get(s), info) == 0; }); }
public Func <State, bool> Get(State state) { return((s) => { return StateInfo.Get(state); }); }
public static IProp <T> Check <T>(this IProp <T> prop, Action <T> assertion) { return(new PropImplementation <T>(() => { var value = prop.Get(); assertion(value); return value; }, prop.GetDescription())); }
private void PrintPropInt(IProp <int> propInt) { Log("PropInt: "); foreach (var state in GetFullState()) { var result = propInt.Get(state); Log("\t" + PrintState(state) + " -> " + result.ToString()); } }
private void PrintPropBool(IProp <bool> propBool, Func <bool, bool> filter) { Log("PropBool: "); foreach (var state in GetFullState()) { var result = propBool.Get(state); if (filter(result)) { Log("\t" + PrintState(state) + " -> " + (result ? "True" : "False")); } } }
internal static void AssertEqualTo <T>(this IProp <T> actual, T expected) { AssertEqualTo(actual.Get(), expected, actual.GetDescription()); }
internal static void AssertStartsWith(this IProp <string> actual, string expected) { AssertStartsWith(actual.Get(), expected, actual.GetDescription()); }
public static void Assert <T>(this IProp <T> property, IResolveConstraint constraint) { NUnit.Framework.Assert.That(property.Get(), new ReusableConstraint(constraint), property.GetDescription()); }
public bool Get(State state) { return(StateInfo1.Get(state) == StateInfo2.Get(state)); }
public static IProp <TNew> Transform <T, TNew>(this IProp <T> prop, Func <T, TNew> transform) { return(new PropImplementation <TNew>(() => transform(prop.Get()), prop.GetDescription())); }
public static IProp <TNew> Then <T, TNew>(this IProp <T> prop, IProp <TNew> then) { return(prop.Transform(x => then.Get())); }