Skip to content

Commit

Permalink
Added unit tests for CTabFolder
Browse files Browse the repository at this point in the history
1. Test selected tab image visibility
2. Test tab minimum character
  • Loading branch information
praveen-skp authored and merks committed Feb 26, 2024
1 parent e0d5976 commit ea87817
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,4 +322,24 @@ void testStyleLabelChildInCTabFolder() {
Label labelToTest = createLabelInCTabFolder("Label { background-color: #0000FF; }\n");
assertEquals(BLUE, labelToTest.getBackground().getRGB());
}

@Test
void testSelectedImageVisible() {
CTabFolder folderToTest = createTestCTabFolder("CTabFolder { swt-selected-image-visible: true}");
assertEquals(true, folderToTest.getSelectedImageVisible());
assertEquals("true", engine.retrieveCSSProperty(folderToTest, "swt-selected-image-visible", null));
folderToTest = createTestCTabFolder("CTabFolder { swt-selected-image-visible: false}");
assertEquals(false, folderToTest.getSelectedImageVisible());
assertEquals("false", engine.retrieveCSSProperty(folderToTest, "swt-selected-image-visible", null));
}

@Test
void testMinimumCharacters() {
CTabFolder folderToTest = createTestCTabFolder("CTabFolder { swt-tab-text-minimum-characters: 1}");
assertEquals(1, folderToTest.getMinimumCharacters());
assertEquals("1", engine.retrieveCSSProperty(folderToTest, "swt-tab-text-minimum-characters", null));
folderToTest = createTestCTabFolder("CTabFolder { swt-tab-text-minimum-characters: 1.2}");
assertEquals(1, folderToTest.getMinimumCharacters());
assertEquals("1", engine.retrieveCSSProperty(folderToTest, "swt-tab-text-minimum-characters", null));
}
}

0 comments on commit ea87817

Please sign in to comment.