// =====================================================================
// Create Mocks
// =====================================================================
PseudoElement beforeMock = new PseudoElementMock(
"beforeMock", expectations);
// =====================================================================
// Set Expectations
// =====================================================================
pseudoEntityProviderMock.expects.getPseudoElement("before")
.returns(beforeMock);
factoryMock.expects.createUniversalMatcher().returns(universalMock);
// Set the expectations on the specificity calculator.
specificityCalculatorMock.expects.addPseudoElementSelector();
// =====================================================================
// Test Expectations
// =====================================================================
PseudoElementSelector themeSelector =
themeModelFactory.createPseudoElementSelector("before");
SelectorSequence sequence = createSelectorSequence(themeSelector);
MatcherBuilder builder = createMatcherBuilder();
Matcher matcher = builder.getMatcher(sequence);
assertSame("Constructed matcher not as expected",
universalMock, matcher);
List entities = builder.getPseudoStyleEntities();
assertEquals("List should contain one item", 1, entities.size());
PseudoElement actual = (PseudoElement) entities.get(0);
assertEquals("Pseudo class set not as expected", beforeMock, actual);
}