@@ -0,0 +1,3108 @@
+package com.mistraltech.smog.core;%0A%0A%0Aimport org.hamcrest.StringDescription;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport static org.hamcrest.CoreMatchers.*;%0Aimport static org.junit.Assert.*;%0A%0Apublic class MatchAccumulatorTest%0A%7B%0A    private StringDescription mismatchDescription;%0A%0A    @Before%0A    public void setUp() %7B%0A        mismatchDescription = new StringDescription();%0A    %7D%0A%0A    @Test%0A    public void givesSuccessResultWhenNoResultSpecifiedAtConstructionAndNoMatchesFail() %7B%0A        MatchAccumulator matchAccumulator = MatchAccumulator.matchAccumulator(mismatchDescription);%0A%0A        assertTrue(matchAccumulator.result());%0A    %7D%0A%0A    @Test%0A    public void givesSuccessResultWhenSucceedingAtConstructionAndNoMatchesFail() %7B%0A        MatchAccumulator matchAccumulator = MatchAccumulator.matchAccumulator(mismatchDescription, true);%0A%0A        assertTrue(matchAccumulator.result());%0A    %7D%0A%0A    @Test%0A    public void givesFailureResultWhenFailingAtConstruction() %7B%0A        MatchAccumulator matchAccumulator = MatchAccumulator.matchAccumulator(mismatchDescription, false);%0A%0A        assertFalse(matchAccumulator.result());%0A    %7D%0A%0A    @Test%0A    public void givesFailureResultWhenAnyMatchFails() %7B%0A        MatchAccumulator matchAccumulator = MatchAccumulator.matchAccumulator(mismatchDescription);%0A%0A        matchAccumulator.matches(equalTo(%22A%22), %22A%22);%0A        matchAccumulator.matches(equalTo(%22B%22), %22-%22);%0A        matchAccumulator.matches(equalTo(%22C%22), %22C%22);%0A%0A        assertFalse(matchAccumulator.result());%0A    %7D%0A%0A    @Test%0A    public void givesSuccessResultWhenAllMatchesSucceed() %7B%0A        MatchAccumulator matchAccumulator = MatchAccumulator.matchAccumulator(mismatchDescription);%0A%0A        matchAccumulator.matches(equalTo(%22A%22), %22A%22);%0A        matchAccumulator.matches(equalTo(%22B%22), %22B%22);%0A        matchAccumulator.matches(equalTo(%22C%22), %22C%22);%0A%0A        assertTrue(matchAccumulator.result());%0A    %7D%0A%0A    @Test%0A    public void doesNotUpdateMismatchDescriptionWhenMatchesSucceed() %7B%0A        MatchAccumulator matchAccumulator = MatchAccumulator.matchAccumulator(mismatchDescription);%0A%0A        matchAccumulator.matches(equalTo(%22A%22), %22A%22);%0A        matchAccumulator.matches(equalTo(%22B%22), %22B%22);%0A        matchAccumulator.matches(equalTo(%22C%22), %22C%22);%0A%0A        assertEquals(%22%22, mismatchDescription.toString());%0A    %7D%0A%0A    @Test%0A    public void updatesMismatchDescriptionForFailingMatches() %7B%0A        MatchAccumulator matchAccumulator = MatchAccumulator.matchAccumulator(mismatchDescription);%0A%0A        matchAccumulator.matches(equalTo(%22A%22), %22a%22); // mismatch%0A        matchAccumulator.matches(equalTo(%22B%22), %22B%22);%0A        matchAccumulator.matches(equalTo(%22C%22), %22c%22); // mismatch%0A        matchAccumulator.matches(equalTo(%22D%22), %22d%22); // mismatch%0A        matchAccumulator.matches(equalTo(%22E%22), %22E%22);%0A%0A        String expectedMismatchDescription = %22was %5C%22a%5C%22%22%0A            + MatchAccumulator.MISMATCH_CONJUNCTIVE_ADVERB%0A            + %22was %5C%22c%5C%22%22%0A            + MatchAccumulator.MISMATCH_CONJUNCTIVE_ADVERB%0A            + %22was %5C%22d%5C%22%22;%0A%0A        assertEquals(expectedMismatchDescription, mismatchDescription.toString());%0A    %7D%0A%7D%0A

Add unit tests for MatchAccumulator.