Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented randomBigDecimal method #41

Merged
merged 3 commits into from
Oct 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
added randomBigDecimal function to return random big decimal numbers
  • Loading branch information
KaroK365 committed Oct 25, 2024
commit 1c00eb454f4bafc5f0f87b525699dc4efef029af
6 changes: 6 additions & 0 deletions src/test/java/dev/nmarulo/depensaapp/FakeTestUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import net.datafaker.Faker;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.ZoneId;

Expand All @@ -12,6 +13,11 @@ public final class FakeTestUtil {
static {
faker = new Faker();
}

public static BigDecimal randomBigDecimal(){
double randomValue = Math.random() * 999 + 1;
return BigDecimal.valueOf(randomValue);
}

public static Integer randomInteger() {
return faker.random()
Expand Down