Skip to content

Commit

Permalink
#502 Fixed code smells for BaseCustomerConfig.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Caleb Murphy committed Oct 16, 2024
1 parent 8505d82 commit 14f9894
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public CustomerComponent(BaseCustomerConfig config) {
this.patience = config.patience;
this.countDown = config.countDown;
this.preference = config.preference;
this.Customer_id = config.Customer_id;
this.Customer_id = config.customerId;
}

/**
Expand All @@ -58,7 +58,7 @@ public CustomerComponent(CustomerPersonalityConfig config) {
this.countDown = config.countDown;
this.reputation = config.reputation;
this.preference = config.preference;
this.Customer_id = config.Customer_id;
this.Customer_id = config.customerId;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ public class BaseCustomerConfig {
private static final int MIN = 100000;
private static final int RANGE = MAX - MIN + 1;

public String type = "Consumer" + Math.random();
public int countDown = 30; // in seconds
public int patience = 100; // in seconds
public static String type = "Consumer" + Math.random();
public static int countDown = 30; // in seconds
public static final int patience = 100; // in seconds

public String texture;
public String preference = "placeholder"; //change to list of recipe or ingredients
public static String texture;
public static String preference = "placeholder"; //change to list of recipe or ingredients

public int Customer_id = (int)(Math.random() * RANGE) + MIN;
public static final int customerId = (int)(Math.random() * RANGE) + MIN;
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ void setup(){
void testPersonalCustomerComponents(){
CustomerPersonalityConfig mockConfigs = new CustomerPersonalityConfig();
mockConfigs.name = "Hank";
mockConfigs.type = "Gorilla";
mockConfigs.countDown = 20;
BaseCustomerConfig.type = "Gorilla";
BaseCustomerConfig.countDown = 20;
mockConfigs.preference = "bananaSplit";
mockConfigs.reputation = 100;

Expand All @@ -44,9 +44,9 @@ void testPersonalCustomerComponents(){
@Test
void testBasicCustomerComponents(){
BaseCustomerConfig basicMockConfigs = new BaseCustomerConfig();
basicMockConfigs.type = "Chicken";
basicMockConfigs.countDown = 20;
basicMockConfigs.preference = "salad";
BaseCustomerConfig.type = "Chicken";
BaseCustomerConfig.countDown = 20;
BaseCustomerConfig.preference = "salad";

CustomerComponent components = new CustomerComponent(basicMockConfigs);
assertEquals(20, components.getCountDown());
Expand Down

0 comments on commit 14f9894

Please sign in to comment.