| 10 | |
| 11 | public class TextStyleTest implements Executable { |
| 12 | @Override |
| 13 | public void execute() throws Exception { |
| 14 | assertEquals(new TextStyle(), new TextStyle()); |
| 15 | |
| 16 | try (var ts1 = new TextStyle(); |
| 17 | var ts2 = new TextStyle();) |
| 18 | { |
| 19 | for (var attr: new TextStyleAttribute[] { |
| 20 | TextStyleAttribute.ALL_ATTRIBUTES, |
| 21 | TextStyleAttribute.FONT, |
| 22 | TextStyleAttribute.FOREGROUND, |
| 23 | TextStyleAttribute.BACKGROUND, |
| 24 | TextStyleAttribute.SHADOW, |
| 25 | TextStyleAttribute.DECORATIONS, |
| 26 | TextStyleAttribute.LETTER_SPACING, |
| 27 | TextStyleAttribute.WORD_SPACING, |
| 28 | TextStyleAttribute.FONT_EXACT}) |
| 29 | { |
| 30 | pushStack(attr.toString()); |
| 31 | assertEquals(true, ts1.equals(attr, ts2)); |
| 32 | assertEquals(true, ts2.equals(attr, ts1)); |
| 33 | popStack(); |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | assertEquals(false, new TextStyle().setColor(0xFFcc3300).equals(TextStyleAttribute.ALL_ATTRIBUTES, new TextStyle().setColor(0xFF00cc33))); |
| 38 | assertEquals(true, new TextStyle().setColor(0xFFcc3300).equals(TextStyleAttribute.BACKGROUND, new TextStyle().setColor(0xFF00cc33))); |
| 39 | } |
| 40 | } |