* @throws Exception if there was a problem rendering the menu item
*/
public void testMCSAttributesAnnotatedWithStyles() throws Exception {
// Create the menu item to test.
ConcreteElementDetails elementDetails = createTestElementDetails();
ConcreteMenuItem item =
new ConcreteMenuItem(elementDetails, new MenuLabelStub());
item.setHref(new LiteralLinkAssetReference("http://www.bbc.co.uk"));
// Create the renderer we are to test.
DefaultAnchorMenuItemRenderer renderer =
new DefaultAnchorMenuItemRenderer(
new TestDeprecatedAnchorOutput(), true, null);
// Render.
TestDOMOutputBuffer buffer = new TestDOMOutputBuffer();
renderer.open(buffer, item);
AnchorAttributes attributes = (AnchorAttributes)PrivateAccessor.
getField(renderer, "attributes");
assertNotNull("MCS Attributes should not be null", attributes);
Styles styles = attributes.getStyles();
assertNotNull("The Styles on the MCS Attributes must not be null",
styles);
assertEquals("The styles on the MCS Attributes must be the same " +
"as the styles on the ElementDetails",
elementDetails.getStyles(), styles);
}