@Test public void shouldTeardownStyles() throws Exception { makeSampleStyles(); styledText = new StyledText("Some Text", "fizz", "bang"); styledText.setupStyles(styles, defaultStyle, new MockStyleObserver()); styledText.teardownStyles(); RichStyle style = styledText.getStyle(); assertEquals(false, style1.hasObserver(style)); assertEquals(false, style2.hasObserver(style)); assertEquals(false, defaultStyle.hasObserver(style)); }
@Test public void shouldBuildStyles() throws Exception { makeSampleStyles(); StyleObserver observer = new MockStyleObserver(); styledText = new StyledText("Some Text", "fizz", "bang"); styledText.setupStyles(styles, defaultStyle, observer); RichStyle style = styledText.getStyle(); assertSame(style1, style.getExtention(0)); assertSame(style2, style.getExtention(1)); assertSame(defaultStyle, style.getExtention(2)); assertEquals(true, style.hasObserver(observer)); }