Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c7daaed

Browse files
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
Lines changed: 22 additions & 0 deletions
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+
}
Lines changed: 7 additions & 0 deletions
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+
}
Lines changed: 5 additions & 0 deletions
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+
}
Lines changed: 37 additions & 0 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /