StandardFunctionFactory { public static StandardFunction getByName(String functionName) { StandardFunction standardFunction = ALL.get(functionName.toLowerCase(Locale.ENGLISH)); return standardFunction != null ? standardFunction : new UnknownFunction(functionName); } private  StandardFunctionFactory(); static StandardFunction getByName(String functionName); static List<StandardFunction> getAll();  }
@Test public void should_return_a_valid_rotatex_function_object() { StandardFunction function = StandardFunctionFactory.getByName("rotatex"); assertEquals(Rotatex.class, function.getClass()); assertEquals(function.getName(), "rotatex"); assertEquals(function.getLinks().size(), 1); assertEquals(function.getLinks().get(0), "https: assertEquals(function.isExperimental(), false); assertEquals(function.isObsolete(), false); }
@Test public void should_return_a_valid_rotatex_function_object_uppercase_test() { StandardFunction function = StandardFunctionFactory.getByName("ROTATEX"); assertEquals(Rotatex.class, function.getClass()); assertEquals(function.getName(), "rotatex"); assertEquals(function.getLinks().size(), 1); assertEquals(function.getLinks().get(0), "https: assertEquals(function.isExperimental(), false); assertEquals(function.isObsolete(), false); }
@Test public void should_return_a_valid_rotatex_function_object_mix_uppercase_lowercase_test() { StandardFunction function = StandardFunctionFactory.getByName("rotateX"); assertEquals(Rotatex.class, function.getClass()); assertEquals(function.getName(), "rotatex"); assertEquals(function.getLinks().size(), 1); assertEquals(function.getLinks().get(0), "https: assertEquals(function.isExperimental(), false); assertEquals(function.isObsolete(), false); }
@Test public void should_return_a_valid_repeating_linear_gradient_function_object() { StandardFunction function = StandardFunctionFactory.getByName("repeating-linear-gradient"); assertEquals(RepeatingLinearGradient.class, function.getClass()); assertEquals(function.getName(), "repeating-linear-gradient"); assertEquals(function.getLinks().size(), 1); assertEquals(function.isExperimental(), false); assertEquals(function.isObsolete(), false); }
@Test public void should_return_a_valid_repeating_linear_gradient_function_object_mix_uppercase_lowercase_test() { StandardFunction function = StandardFunctionFactory.getByName("repEating-Linear-gradient"); assertEquals(RepeatingLinearGradient.class, function.getClass()); assertEquals(function.getName(), "repeating-linear-gradient"); assertEquals(function.getLinks().size(), 1); assertEquals(function.isExperimental(), false); assertEquals(function.isObsolete(), false); }