public void ShouldTriggerOnTotalMisusageWithObjectEquals_Left() { var hint = new TimeSpanTotalMistakesHint(); Expression <Func <bool> > x = () => Equals(TimeSpan.FromMinutes(63).Minutes, 63); var p = new ExpressionParser(x.Body); string description; Assert.IsTrue(hint.TryGetHint(p, x.Body, out description)); Assert.IsNotNull(description); }
public void DoesntExplodeOnNonTotalMethods() { var hint = new TimeSpanTotalMistakesHint(); Expression <Func <bool> > x = () => Equals(TimeSpan.FromMinutes(63).Ticks, 63); var p = new ExpressionParser(x.Body); string description; Assert.IsFalse(hint.TryGetHint(p, x.Body, out description)); Assert.IsNull(description); }
public void DoesntTriggerIfTheyWouldNotBeEqual() { var hint = new TimeSpanTotalMistakesHint(); Expression <Func <bool> > x = () => Equals(TimeSpan.FromMinutes(63).Minutes, 62); var p = new ExpressionParser(x.Body); string description; Assert.IsFalse(hint.TryGetHint(p, x.Body, out description)); Assert.IsNull(description); }