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 pathAfdelingTest.java
149 lines (133 loc) · 3.66 KB
/
AfdelingTest.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/*
* 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.awt.Point;
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 Niels
*/
public class AfdelingTest
{
private static Afdeling testing;
private static Controller controller = new Controller();
private static Personeel personeeltest;
public AfdelingTest()
{
}
@BeforeClass
public static void setUpClass()
{
}
@AfterClass
public static void tearDownClass()
{
}
@Before
public void setUp()
{
testing = new Afdeling("test afdeling", new ArrayList<Point>(),new ArrayList<ProductWrapper>(), 10);
personeeltest = new Personeel("test personeel", new Point(1,31), 3, controller);
}
@After
public void tearDown()
{
testing = null;
}
/**
* Test of padPoint method, of class Afdeling.
*/
@Test
public void testPadPoint()
{
System.out.println("padPoint");
Point p = new Point(1, 4);
Afdeling instance = testing;
instance.padPoint(p);
if(controller.bord[p.x][p.y].getItem() == 5)
assertEquals(controller.bord[p.x][p.y].getItem(), 5);
else if (controller.bord[p.x][p.y].getItem() == 6)
assertEquals(controller.bord[p.x][p.y].getItem(), 6);
else
fail("this is a prototype");
}
/**
* Test of bemanAfdeling method, of class Afdeling.
*/
@Test
public void testBemanAfdeling()
{
System.out.println("bemanAfdeling");
Personeel personeel = personeeltest;
Afdeling instance = testing;
instance.bemanAfdeling(personeel);
// assertEquals(instance.personeel, personeel); Maak personeel public!
}
/**
* Test of setMax method, of class Afdeling.
*/
@Test
public void testSetMax()
{
System.out.println("setMax");
int max = 0;
Afdeling instance = testing;
instance.setMax(max);
assertEquals(instance.maxProduct, max);
}
/**
* Test of onbemanAfdeling method, of class Afdeling.
*/
@Test
public void testOnbemanAfdeling()
{
System.out.println("onbemanAfdeling");
Afdeling instance = testing;
instance.onbemanAfdeling();
// assertEquals(instance.personeel, null); Maak personeel public!
}
/**
* Test of isBemand method, of class Afdeling.
*/
@Test
public void testIsBemand()
{
System.out.println("isBemand");
Afdeling instance = testing;
boolean result = instance.isBemand();
assertEquals(false, result);
}
/**
* Test of getNaam method, of class Afdeling.
*/
@Test
public void testGetNaam()
{
System.out.println("getNaam");
Afdeling instance = testing;
String result = instance.getNaam();
assertEquals("test afdeling", result);
}
/**
* Test of loadAfdeling method, of class Afdeling.
*/
@Test
public void testLoadAfdeling()
{
System.out.println("loadAfdeling");
List<List<ProductWrapper>> productWrappers = new ArrayList<List<ProductWrapper>>();
List<Afdeling> expResult = new ArrayList<>();
List<Afdeling> result = Afdeling.loadAfdeling(productWrappers);
assertEquals(expResult, result);
}
}