package org.slc.sli.api.selectors.model;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slc.sli.modeling.uml.Type;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.mock;


/**
 * @author jstokes
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "/spring/applicationContext-test.xml" })
public class SemanticSelectorTest {
    private SemanticSelector selector;

    @Before
    public void setup() {
        selector = new SemanticSelector();
    }

    @Test
    public void testAddSelector() {
        final Type testType = mock(Type.class);
        final SelectorElement se = mock(SelectorElement.class);
        selector.addSelector(testType, se);
        assertNotNull(selector.get(testType));
        assertEquals(1, selector.get(testType).size());

        selector.addSelector(testType, mock(BooleanSelectorElement.class));
        assertEquals(2, selector.get(testType).size());
    }
}

@@ -116,16 +116,75 @@
 unWith;%0A
+import org.slc.sli.api.selectors.doc.SelectorQueryVisitor;%0A
 import o
@@ -461,28 +461,113 @@
 org.
-mockito.Mockito.mock
+junit.Assert.assertTrue;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.verify
 ;%0A%0A%0A
@@ -1317,11 +1317,315 @@
 );%0A    %7D
+%0A%0A    @Test%0A    public void testToString() %7B%0A        assertTrue(selector.toString().isEmpty());%0A    %7D%0A%0A    @Test%0A    public void testVisitor() %7B%0A        final SelectorQueryVisitor visitor = mock(SelectorQueryVisitor.class);%0A        selector.accept(visitor);%0A        verify(visitor).visit(selector);%0A    %7D
 %0A%7D%0A

Update SemanticSelector unit test