Esempio n. 1
0
    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);
     });
 }
Esempio n. 3
0
 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()));
 }
Esempio n. 4
0
    private void PrintPropInt(IProp <int> propInt)
    {
        Log("PropInt: ");

        foreach (var state in GetFullState())
        {
            var result = propInt.Get(state);
            Log("\t" + PrintState(state) + " -> " + result.ToString());
        }
    }
Esempio n. 5
0
    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"));
            }
        }
    }
Esempio n. 6
0
 internal static void AssertEqualTo <T>(this IProp <T> actual, T expected)
 {
     AssertEqualTo(actual.Get(), expected, actual.GetDescription());
 }
Esempio n. 7
0
 internal static void AssertStartsWith(this IProp <string> actual, string expected)
 {
     AssertStartsWith(actual.Get(), expected, actual.GetDescription());
 }
Esempio n. 8
0
 public static void Assert <T>(this IProp <T> property, IResolveConstraint constraint)
 {
     NUnit.Framework.Assert.That(property.Get(), new ReusableConstraint(constraint), property.GetDescription());
 }
Esempio n. 9
0
 public bool Get(State state)
 {
     return(StateInfo1.Get(state) == StateInfo2.Get(state));
 }
Esempio n. 10
0
 public static IProp <TNew> Transform <T, TNew>(this IProp <T> prop, Func <T, TNew> transform)
 {
     return(new PropImplementation <TNew>(() => transform(prop.Get()), prop.GetDescription()));
 }
Esempio n. 11
0
 public static IProp <TNew> Then <T, TNew>(this IProp <T> prop, IProp <TNew> then)
 {
     return(prop.Transform(x => then.Get()));
 }