public void EmptyFirstJustWorks() { DifferenceEvaluator d = DifferenceEvaluators.First(); Assert.AreEqual(ComparisonResult.DIFFERENT, d(null, ComparisonResult.DIFFERENT)); }
public void FirstChangeWinsInFirst() { Evaluator e1 = new Evaluator(ComparisonResult.DIFFERENT); Evaluator e2 = new Evaluator(ComparisonResult.EQUAL); DifferenceEvaluator d = DifferenceEvaluators.First(e1.Evaluate, e2.Evaluate); Assert.AreEqual(ComparisonResult.DIFFERENT, d(null, ComparisonResult.SIMILAR)); Assert.IsTrue(e1.Called); Assert.IsFalse(e2.Called); e1.Called = false; Assert.AreEqual(ComparisonResult.EQUAL, d(null, ComparisonResult.DIFFERENT)); Assert.IsTrue(e1.Called); Assert.IsTrue(e2.Called); }