MCPcopy Create free account
hub / github.com/DiUS/java-faker / apply

Method apply

src/test/java/com/github/javafaker/NumberTest.java:205–216  ·  view source on GitHub ↗
(Pair<Long, Long> minMax)

Source from the content-addressed store, hash-verified

203 public void randomDoubleRandomizationQuality() {
204 Function<Pair<Long, Long>, Double> minMaxRangeToUniquePercentageFunction = new Function<Pair<Long, Long>, Double>() {
205 @Override
206 public Double apply(Pair<Long, Long> minMax) {
207 final int min = minMax.getLeft().intValue(), max = minMax.getRight().intValue();
208 long numbersToGet = calculateNumbersToGet(min, max);
209
210 return uniquePercentageOfResults(numbersToGet, new Callable<Double>() {
211 @Override
212 public Double call() throws Exception {
213 return faker.number().randomDouble(0, min, max);
214 }
215 });
216 }
217 };
218
219 final double percentGreaterThan80Percent = randomizationQualityTest(individualRunGtPercentUnique, minMaxRangeToUniquePercentageFunction);

Calls 2

calculateNumbersToGetMethod · 0.95

Tested by

no test coverage detected