public void WithEnablersTest() { EnablerHeuristic heuristic = new EnablerHeuristic(); Type type = typeof(WithEnabler); MethodInfo method = type.GetMethod("CanDoSomething"); bool selectable = heuristic.IsSelectable(method); Assert.That(selectable, Is.True); }
public void WithNoEnablersTest() { EnablerHeuristic heuristic = new EnablerHeuristic(); Type type = typeof(WithOperation); MethodInfo[] methods = type.GetMethods(); bool selectable = heuristic.IsSelectable(methods[0]); Assert.That(selectable, Is.False); }
public void EnablerPrecedenceOverOperations() { OperationsHeuristic heuristic = new OperationsHeuristic(); EnablerHeuristic enablerHeuristic = new EnablerHeuristic(); Type type = typeof(WithEnabler); MethodInfo method = type.GetMethod("CanDoSomething"); bool hasPrecedence = enablerHeuristic.HasPrecedence(heuristic, method); Assert.That(hasPrecedence, Is.True); }