Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
ArtTest.java
1 package org.bukkit;
2 
3 import static org.hamcrest.CoreMatchers.is;
4 import static org.hamcrest.Matchers.greaterThan;
5 import static org.junit.Assert.assertThat;
6 
7 import org.junit.Test;
8 
9 public class ArtTest {
10 
11  @Test(expected = IllegalArgumentException.class)
12  public void getByNullName() {
13  Art.getByName(null);
14  }
15 
16  @Test
17  public void getById() {
18  for (Art art : Art.values()) {
19  assertThat(Art.getById(art.getId()), is(art));
20  }
21  }
22 
23  @Test
24  public void getByName() {
25  for (Art art : Art.values()) {
26  assertThat(Art.getByName(art.toString()), is(art));
27  }
28  }
29 
30  @Test
31  public void dimensionSanityCheck() {
32  for (Art art : Art.values()) {
33  assertThat(art.getBlockHeight(), is(greaterThan(0)));
34  assertThat(art.getBlockWidth(), is(greaterThan(0)));
35  }
36  }
37 
38  @Test
39  public void getByNameWithMixedCase() {
40  Art subject = Art.values()[0];
41  String name = subject.toString().replace('E', 'e');
42 
43  assertThat(Art.getByName(name), is(subject));
44  }
45 }
static Art getByName(String name)
Definition: Art.java:99
static Art getById(int id)
Definition: Art.java:87