-
Notifications
You must be signed in to change notification settings - Fork 98
Expand file tree
/
Copy pathBasketManagerTest.java
More file actions
36 lines (30 loc) · 942 Bytes
/
BasketManagerTest.java
File metadata and controls
36 lines (30 loc) · 942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.booleanuk.core;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
public class BasketManagerTest {
@Test
public void searchForProductThatExists(){
//setup
BasketManager basketManager = new BasketManager();
String product = "Butter";
int price = 50;
// Execute and Verify
Assertions.assertTrue(basketManager.add(product, price));
}
@Test
public void searchProductThatDoesNotExists(){
//setup
BasketManager basketManager = new BasketManager();
String product = "Salt";
int price = 10;
// Execute and Verify
Assertions.assertFalse(basketManager.add(product, price));
}
@Test
public void TestTotal(){
//setup
BasketManager basketManager = new BasketManager();
//Execute and Verify
Assertions.assertEquals(210, basketManager.total());
}
}