Skip to content

Commit

Permalink
Add test for visibility checks
Browse files Browse the repository at this point in the history
  • Loading branch information
CarstenWickner committed Jun 18, 2019
1 parent 4dec432 commit 27f48b9
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ public MemberScopeTest() {
super(TestClass.class);
}

@Test
@Parameters({
"privateVisibleField, true, false, false",
"packageVisibleField, false, false, false",
"protectedVisibleField, false, true, false",
"publicVisibleField, false, false, true"
})
public void testGetVisibility(String fieldName, boolean isPrivate, boolean isProtected, boolean isPublic) {
FieldScope field = this.getTestClassField(fieldName);

Assert.assertEquals(isPrivate, field.isPrivate());
Assert.assertEquals(isProtected, field.isProtected());
Assert.assertEquals(isPublic, field.isPublic());
}

Object parametersForTestContainerType() {
return new Object[][]{
{"getStringArray", true, String.class},
Expand Down

0 comments on commit 27f48b9

Please sign in to comment.