autofixture.publicinterface.inline.strings.UppercaseStringGenerator Maven / Gradle / Ivy
The newest version!
package autofixture.publicinterface.inline.strings;
import autofixture.interfaces.FixtureContract;
import autofixture.interfaces.InlineGeneratorsFactory;
import autofixture.interfaces.InlineInstanceGenerator;
/**
* Created by grzes on 26.11.2016.
*/
public class UppercaseStringGenerator implements InlineInstanceGenerator {
private final int length;
private InlineGeneratorsFactory inlineGeneratorsFactory;
public UppercaseStringGenerator(int length, InlineGeneratorsFactory inlineGeneratorsFactory) {
this.length = length;
this.inlineGeneratorsFactory = inlineGeneratorsFactory;
}
@Override
public String next(FixtureContract fixture) {
return fixture.create(
inlineGeneratorsFactory.stringOfLength(length)).toUpperCase();
}
}