I'm working on a project in college in which I am to create my own objects, along with private data, methods, etc. This isn’t a complete working system with a user interface; it’s just a chance for to create classes, then instantiate and test them.
The issue is that I'm trying to create a test method which tests a thrown IllegalArgumentException in a constructor called DinetteStore:
public DinetteStore(int tableInventory, int chairInventory, int leafInventory){
if (tableInventory < 0 || leafInventory < 0 || chairInventory < 0){
throw new IllegalArgumentException ("Inventory must not be out of range of required order");
}
this.tableInventory = tableInventory;
this.chairInventory = chairInventory;
this.leafInventory = leafInventory;
this.totalSales = 0;
this.numSales = 0;
}
The code in the test class is listed here:
@Test (expected = IllegalArgumentException.class)
public void testIllegalArgumentChair() {
int tableInventory = -1 || int leafInventory = -1 || chairInventory = -1;
}
I'm running into an issue where I'm getting either a .class expected error or illegal start of expression error. The IDE I'm using is BlueJ 4.1.0 Is there something I'm missing syntax-wise here? Any help would be surely appreciated.