示例#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);
     });
 }
示例#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()));
 }
示例#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());
        }
    }
示例#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"));
            }
        }
    }
示例#6
0
 internal static void AssertEqualTo <T>(this IProp <T> actual, T expected)
 {
     AssertEqualTo(actual.Get(), expected, actual.GetDescription());
 }
示例#7
0
 internal static void AssertStartsWith(this IProp <string> actual, string expected)
 {
     AssertStartsWith(actual.Get(), expected, actual.GetDescription());
 }
示例#8
0
 public static void Assert <T>(this IProp <T> property, IResolveConstraint constraint)
 {
     NUnit.Framework.Assert.That(property.Get(), new ReusableConstraint(constraint), property.GetDescription());
 }
示例#9
0
 public bool Get(State state)
 {
     return(StateInfo1.Get(state) == StateInfo2.Get(state));
 }
示例#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()));
 }
示例#11
0
 public static IProp <TNew> Then <T, TNew>(this IProp <T> prop, IProp <TNew> then)
 {
     return(prop.Transform(x => then.Get()));
 }