Test for class RefineHolder.java
[yangtools.git] / code-generator / binding-generator-impl / src / test / java / org / opendaylight / yangtools / sal / binding / yang / types / NodeWrappedTypeTest.java
1 package org.opendaylight.yangtools.sal.binding.yang.types;
2
3 import static org.junit.Assert.*;
4
5 import org.junit.Test;
6
7 public class NodeWrappedTypeTest {
8
9     @Test
10     public void test() {
11         NodeWrappedType nwt1 = new NodeWrappedType("obj1");
12         NodeWrappedType nwt2 = new NodeWrappedType("obj2");
13         NodeWrappedType nwt3 = new NodeWrappedType("obj1");
14         String str = "obj3";
15
16         assertTrue("Node nwt1 should equal to itself.", nwt1.equals(nwt1));
17         assertFalse("It can't be possible to compare nwt with string.", nwt1.equals(str));
18         assertFalse("nwt1 shouldn't equal to nwt2.", nwt1.equals(nwt2));
19         assertTrue("Node nwt1 should equal to nwt3.", nwt1.equals(nwt3));
20
21         assertEquals("toString method is returning incorrect value.", "NodeWrappedType{wrappedType=obj1}",
22                 nwt1.toString());
23     }
24 }