* @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());
// Create the renderer we are to test.
DefaultSpanMenuItemRenderer renderer =
new DefaultSpanMenuItemRenderer(
new TestDeprecatedSpanOutput());
// Render.
TestDOMOutputBuffer buffer = new TestDOMOutputBuffer();
renderer.open(buffer, item);
SpanAttributes attributes = (SpanAttributes)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);
}