Search in sources :

Example 1 with SubstitutionSpanStrategy

use of org.eclipse.mylyn.wikitext.html.internal.SubstitutionSpanStrategy in project mylyn.docs by eclipse.

the class SpanStrategiesTest method alternatives.

@Test
public void alternatives() {
    SpanStrategies strategies = new SpanStrategies(Sets.newHashSet(SpanType.BOLD), Collections.<SpanHtmlElementStrategy>emptyList());
    assertTrue(strategies.getStrategy(SpanType.STRONG, new Attributes()) instanceof SubstitutionSpanStrategy);
}
Also used : SubstitutionSpanStrategy(org.eclipse.mylyn.wikitext.html.internal.SubstitutionSpanStrategy) Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) SpanStrategies(org.eclipse.mylyn.wikitext.html.internal.SpanStrategies) Test(org.junit.Test)

Example 2 with SubstitutionSpanStrategy

use of org.eclipse.mylyn.wikitext.html.internal.SubstitutionSpanStrategy in project mylyn.docs by eclipse.

the class SubstitutionSpanStrategyTest method substitution.

@Test
public void substitution() {
    SubstitutionSpanStrategy strategy = new SubstitutionSpanStrategy(SpanType.BOLD);
    strategy.beginSpan(builder, SpanType.CODE, new Attributes());
    builder.characters("test");
    strategy.endSpan(builder);
    assertEquals("<b>test</b>", writer.toString());
}
Also used : SubstitutionSpanStrategy(org.eclipse.mylyn.wikitext.html.internal.SubstitutionSpanStrategy) Attributes(org.eclipse.mylyn.wikitext.parser.Attributes) Test(org.junit.Test)

Aggregations

SubstitutionSpanStrategy (org.eclipse.mylyn.wikitext.html.internal.SubstitutionSpanStrategy)2 Attributes (org.eclipse.mylyn.wikitext.parser.Attributes)2 Test (org.junit.Test)2 SpanStrategies (org.eclipse.mylyn.wikitext.html.internal.SpanStrategies)1