Esempio n. 1
0
        public static string GetMember(Expression linqExpression)
        {
            var visitor = new FindMemberVisitor();

            visitor.Visit(linqExpression);
            return(visitor.ToString());
        }
Esempio n. 2
0
        public static bool AssertDelta <T, TValue>(JToken delta, Expression <Func <T, TValue> > property, object before, object after)
        {
            var path = FindMemberVisitor.GetMember(property);

            var entry = delta.SelectToken($"$.{path}");

            PAssert.IsTrue(() => Equals(entry[0].Value <TValue>(), before));
            PAssert.IsTrue(() => Equals(entry[1].Value <TValue>(), after));

            return(true);
        }