e6d895d69eef48e418ffc0bed72d0d548f434596
[mdsal.git] / code-generator / binding-generator-impl / src / test / java / org / opendaylight / yangtools / sal / binding / yang / types / NodeWrappedTypeTest.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.yangtools.sal.binding.yang.types;
9
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertFalse;
12 import static org.junit.Assert.assertTrue;
13
14 import org.junit.Test;
15
16 public class NodeWrappedTypeTest {
17
18     @Test
19     public void test() {
20         NodeWrappedType nwt1 = new NodeWrappedType("obj1");
21         NodeWrappedType nwt2 = new NodeWrappedType("obj2");
22         NodeWrappedType nwt3 = new NodeWrappedType("obj1");
23         String str = "obj3";
24
25         assertTrue("Node nwt1 should equal to itself.", nwt1.equals(nwt1));
26         assertFalse("It can't be possible to compare nwt with string.", nwt1.equals(str));
27         assertFalse("nwt1 shouldn't equal to nwt2.", nwt1.equals(nwt2));
28         assertTrue("Node nwt1 should equal to nwt3.", nwt1.equals(nwt3));
29
30         assertEquals("toString method is returning incorrect value.", "NodeWrappedType{wrappedType=obj1}",
31                 nwt1.toString());
32     }
33 }