diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 7a4bf35..65de713 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -6,9 +6,10 @@ + - + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..712ab9d --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 43c1af2..daa7978 100644 --- a/pom.xml +++ b/pom.xml @@ -22,4 +22,19 @@ + + + org.junit.jupiter + junit-jupiter-engine + 5.4.2 + test + + + org.junit.jupiter + junit-jupiter-api + 5.4.2 + test + + + \ No newline at end of file diff --git a/src/main/java/models/DVDs.java b/src/main/java/models/DVDs.java new file mode 100644 index 0000000..95985ea --- /dev/null +++ b/src/main/java/models/DVDs.java @@ -0,0 +1,55 @@ +package models; + +public class DVDs { + private int id; + private String name; + private int qty; + private float price; + + public DVDs(Integer id, String name, Integer qty, Float price) { + this.id = id; + this.name = name; + this.qty = qty; + this.price = price; + } + + public DVDs() { + + } + + public Integer getId() { + return this.id; + } + + + public void setName(String name){ + this.name=name; + } + + + public String getName() { + return this.name; + } + + + + public void setQty(Integer qty){ + this.qty = qty; + } + + public Integer getQty(){ + return this.qty; + } + + + public void setPrice(Float price){ + this.price = price; + } + + public Float getPrice() { + return this.price; + } + + + +} diff --git a/src/main/java/models/RunningShoes.java b/src/main/java/models/RunningShoes.java new file mode 100644 index 0000000..369f808 --- /dev/null +++ b/src/main/java/models/RunningShoes.java @@ -0,0 +1,78 @@ +package models; + +public class RunningShoes { + private int id; + private String name; + private String brand; + private double size; + private int qty; + private float price; + + + + + public RunningShoes(Integer id, String name, String brand, Double size, Integer qty, Float price) { + this.id = id; + this.name = name; + this.brand = brand; + this.size = size; + this.qty = qty; + this.price = price; + } + + public RunningShoes() { + + } + + public void setName(String name){ + this.name=name; + } + + + public String getName() { + return this.name; + } + + public void setBrand(String brand){ + this.brand = brand; + } + + public String getBrand(){ + return this.brand; + } + + public void setSize(Double size) { + this.size = size; + } + + public Double getSize() { + return this.size; + } + + public void setQty(Integer qty){ + this.qty = qty; + } + + public Integer getQty(){ + return this.qty; + } + + + public void setPrice(Float price){ + this.price = price; + } + + public Float getPrice() { + return this.price; + } + + public Integer getId() { + return this.id; + } + + + + +} + + diff --git a/src/main/java/services/DVDs.java b/src/main/java/services/DVDs.java new file mode 100644 index 0000000..5f0f466 --- /dev/null +++ b/src/main/java/services/DVDs.java @@ -0,0 +1,4 @@ +package services; + +public class DVDs { +} diff --git a/src/main/java/services/RunningShoes.java b/src/main/java/services/RunningShoes.java new file mode 100644 index 0000000..85df57b --- /dev/null +++ b/src/main/java/services/RunningShoes.java @@ -0,0 +1,35 @@ +package services; + +import java.util.ArrayList; +import java.util.List; + +public class RunningShoes { + private static int nextId = 1; // (1) + + private List inventory = new ArrayList<>(); + + public models.RunningShoes create(Integer id, String name, String brand, double size, Integer quantity, float price) { + + models.RunningShoes createdShoes = new models.RunningShoes(nextId++, name, brand, size, quantity, price); + + inventory.add(createdShoes); + + + return createdShoes; + } + + // read + public RunningShoes findRunningShoes(int id) { + for(int i = 0; i