-
Notifications
You must be signed in to change notification settings - Fork 0
/
BMPtoASCIITest.java
35 lines (28 loc) · 938 Bytes
/
BMPtoASCIITest.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
package lab06.asciiart;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
public class BMPtoASCIITest {
private BMPtoASCII bmp;
@Before
public void setUp() throws Exception {
String filename = "src/lab06/asciiart/images/monalisa";
bmp = new BMPtoASCII(filename);
}
@Test
public void testReadFile() {
bmp.readFile();
assertEquals("Wrong width", 516, bmp.getWidth());
assertEquals("Wrong height", 547, bmp.getHeight());
}
@Test
public void testGetIntensity() {
bmp.readFile();
assertEquals("Wrong intensity", 69, bmp.getIntensity(0, 0));
assertEquals("Wrong intensity", 72, bmp.getIntensity(0, 515));
assertEquals("Wrong intensity", 85, bmp.getIntensity(1, 0));
assertEquals("Wrong intensity", 82, bmp.getIntensity(1, 515));
assertEquals("Wrong intensity", 107, bmp.getIntensity(546, 0));
assertEquals("Wrong intensity", 106, bmp.getIntensity(546, 515));
}
}