This repository has been archived by the owner on Jun 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVrachtwagenTest.java
98 lines (88 loc) · 2.37 KB
/
VrachtwagenTest.java
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package supermarkt.simulator;
import java.util.ArrayList;
import java.util.List;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Allard
*/
public class VrachtwagenTest
{
private Product testProduct = new Product("Test Product", 0.0, 1);
private Vrachtwagen vrachtwagen;
private static Controller controller;
List<Product> testList;
public VrachtwagenTest()
{
}
@BeforeClass
public static void setUpClass()
{
controller = new Controller();
}
@AfterClass
public static void tearDownClass()
{
}
@Before
public void setUp()
{
testList = new ArrayList<>();
testList.add(testProduct);
vrachtwagen = new Vrachtwagen(testList, 1);
}
@After
public void tearDown()
{
testProduct = null;
}
/**
* Test constructor method, of class Vrachtwagen.
*/
@Test
public void testVrachtwagen()
{
System.out.println("Vrachtwagen aanroepen");
Vrachtwagen instance = new Vrachtwagen(testList, 1);
assertEquals(instance.wordtGelost, false);
//assertEquals(instance.lading.get(0).getProductNaam(),testList.get(0).getNaam()); // Maak lading public!
//assertEquals(instance.aangeroepen,11); //Maak aangeroepen public!
}
/**
* Test of ontladen method, of class Vrachtwagen.
*/
@Test
public void testOntladen()
{
System.out.println("ontladen");
Vrachtwagen instance = vrachtwagen;
boolean expResult = false;
boolean result = instance.ontladen();
assertEquals(expResult, result);
expResult = true;
result = instance.ontladen();
assertEquals(expResult, result);
}
/**
* Test of getAangeroepen method, of class Vrachtwagen.
*/
@Test
public void testGetAangeroepen()
{
System.out.println("getAangeroepen");
Vrachtwagen instance = vrachtwagen;
int expResult = 11;
int result = instance.getAangeroepen();
assertEquals(expResult, result);
}
}