317f02e6d91e077cc44187b9ca2900210c1af692
[yangtools.git] / code-generator / binding-type-provider / 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.*;
11
12 import org.junit.Test;
13
14 public class NodeWrappedTypeTest {
15
16     @Test
17     public void test() {
18         NodeWrappedType nwt1 = new NodeWrappedType("obj1");
19         NodeWrappedType nwt2 = new NodeWrappedType("obj2");
20         NodeWrappedType nwt3 = new NodeWrappedType("obj1");
21         String str = "obj3";
22
23         assertTrue("Node nwt1 should equal to itself.", nwt1.equals(nwt1));
24         assertFalse("It can't be possible to compare nwt with string.", nwt1.equals(str));
25         assertFalse("nwt1 shouldn't equal to nwt2.", nwt1.equals(nwt2));
26         assertTrue("Node nwt1 should equal to nwt3.", nwt1.equals(nwt3));
27
28         assertEquals("toString method is returning incorrect value.", "NodeWrappedType{wrappedType=obj1}",
29                 nwt1.toString());
30     }
31 }