public object CalcualteShouldAddCorrectly(Operand left, Operand right) { var actual = testee.Calculate(left, right); var result = Expression.Lambda(actual.Expression).Compile().DynamicInvoke(); Assert.AreEqual(result.GetType(), actual.OperandType); return result; }
public bool CompareShouldReturnCorrectValue(Operand left, Operand right) { var instance = new CustomEntity { Decimal = 10m, Guid = new Guid("0A740AE1-7B47-467C-9149-D618C5D999F8"), DateTime = new DateTime(2000, 12, 12), DateTimeOffset = DateTimeOffset.Parse("2020/2/2"), TimeSpan = TimeSpan.FromDays(5), String = "Entity" }; var expression = Expression.Constant(instance); var result = testee.Compare(expression, left, right); return (bool)Expression.Lambda(result.Expression).Compile().DynamicInvoke(); }
public override Operand Compare(Expression current, Operand left, Operand right) { throw new NotImplementedException(); }
public override Operand Calculate(Operand left, Operand right) { throw new NotImplementedException(); }