Skip to content

Commit c7daaed

Browse files
committed
Added draft of SortTester to facilitate the creation of the next tests
1 parent 7b08c6b commit c7daaed

File tree

4 files changed

+71
-0
lines changed

4 files changed

+71
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package br.com.zevolution.algorithms.sorting;
2+
3+
public class Product {
4+
5+
private String description;
6+
private double price;
7+
8+
public Product(String description, double price) {
9+
this.description = description;
10+
this.price = price;
11+
}
12+
13+
public double getPrice() {
14+
return price;
15+
}
16+
17+
@Override
18+
public String toString() {
19+
return this.description;
20+
}
21+
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package br.com.zevolution.algorithms.sorting;
2+
3+
public interface Sort {
4+
5+
Product[] sort(Product[] products, int length);
6+
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package br.com.zevolution.algorithms.sorting;
2+
3+
public class SortTester {
4+
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package br.com.zevolution.algorithms.sorting;
2+
3+
public class SortingTestData {
4+
5+
public static final Product[] SORTED_BY_LOWEST_PRICE = {
6+
new Product("Mouse", 50),
7+
new Product("Keyboard", 100),
8+
new Product("Notebook", 3500),
9+
new Product("iPhone 12 Pro Max Ultra Uou", 10000),
10+
new Product("iMac", 30000)
11+
};
12+
13+
public static final Product[] SORTED_BY_HIGHEST_PRICE = {
14+
new Product("iMac", 30000),
15+
new Product("iPhone 12 Pro Max Ultra Uou", 10000),
16+
new Product("Notebook", 3500),
17+
new Product("Keyboard", 100),
18+
new Product("Mouse", 50)
19+
};
20+
21+
public static final Product[] NOT_SORTED = {
22+
new Product("iPhone 12 Pro Max Ultra Uou", 10000),
23+
new Product("Keyboard", 100),
24+
new Product("Notebook", 3500),
25+
new Product("Mouse", 50),
26+
new Product("iMac", 30000)
27+
};
28+
29+
public static final Product[] SAME_PRODUCT = {
30+
new Product("Mouse", 50),
31+
new Product("Mouse", 50),
32+
new Product("Mouse", 50),
33+
new Product("Mouse", 50),
34+
new Product("Mouse", 50)
35+
};
36+
37+
}

0 commit comments

Comments
 (0)