1
2
3
4
5
6
7
8
9
10
11 package org.eclipse.jgit.attributes;
12
13 import static org.junit.Assert.assertEquals;
14 import static org.junit.Assert.assertNull;
15
16 import org.eclipse.jgit.attributes.Attribute.State;
17 import org.junit.Test;
18
19
20
21
22 public class AttributeTest {
23
24 @Test
25 public void testBasic() {
26 Attribute a = new Attribute("delta", State.SET);
27 assertEquals(a.getKey(), "delta");
28 assertEquals(a.getState(), State.SET);
29 assertNull(a.getValue());
30 assertEquals(a.toString(), "delta");
31
32 a = new Attribute("delta", State.UNSET);
33 assertEquals(a.getKey(), "delta");
34 assertEquals(a.getState(), State.UNSET);
35 assertNull(a.getValue());
36 assertEquals(a.toString(), "-delta");
37
38 a = new Attribute("delta", "value");
39 assertEquals(a.getKey(), "delta");
40 assertEquals(a.getState(), State.CUSTOM);
41 assertEquals(a.getValue(), "value");
42 assertEquals(a.toString(), "delta=value");
43 }
44 }