CssMappingUtils { public static BackgroundRepeatValue parseBackgroundRepeat(String value) { switch (value) { case CommonCssConstants.NO_REPEAT: return BackgroundRepeatValue.NO_REPEAT; case CommonCssConstants.ROUND: return BackgroundRepeatValue.ROUND; case CommonCssConstants.SPACE: return BackgroundRepeatValue.SPACE; case CommonCssConstants.REPEAT: default: return BackgroundRepeatValue.REPEAT; } } private  CssMappingUtils(); static BackgroundRepeatValue parseBackgroundRepeat(String value);  }
@Test public void parseBackgroundRepeatTest() { Assert.assertEquals(BackgroundRepeatValue.REPEAT, CssMappingUtils.parseBackgroundRepeat("repeat")); Assert.assertEquals(BackgroundRepeatValue.REPEAT, CssMappingUtils.parseBackgroundRepeat("RePeAt")); Assert.assertEquals(BackgroundRepeatValue.NO_REPEAT, CssMappingUtils.parseBackgroundRepeat("no-repeat")); Assert.assertEquals(BackgroundRepeatValue.REPEAT, CssMappingUtils.parseBackgroundRepeat("no- repeat")); Assert.assertEquals(BackgroundRepeatValue.ROUND, CssMappingUtils.parseBackgroundRepeat("round")); Assert.assertEquals(BackgroundRepeatValue.REPEAT, CssMappingUtils.parseBackgroundRepeat("ro!und")); Assert.assertEquals(BackgroundRepeatValue.SPACE, CssMappingUtils.parseBackgroundRepeat("space")); Assert.assertEquals(BackgroundRepeatValue.REPEAT, CssMappingUtils.parseBackgroundRepeat(" space ")); Assert.assertEquals(BackgroundRepeatValue.REPEAT, CssMappingUtils.parseBackgroundRepeat("something")); }