2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.mdsal.binding.java.api.generator;
10 import static org.junit.Assert.assertEquals;
12 import java.math.BigInteger;
13 import org.junit.Test;
14 import org.opendaylight.yangtools.yang.common.Decimal64;
16 public class Decimal64RangeGeneratorTest {
19 public void convertTest() {
20 Decimal64RangeGenerator generator = new Decimal64RangeGenerator();
21 Decimal64 one = Decimal64.valueOf(1, 1);
22 assertEquals(one, generator.convert(1L));
23 assertEquals(one, generator.convert(new BigInteger("1")));
24 assertEquals(one, generator.convert(Byte.valueOf("1")));
25 assertEquals(one, generator.convert(Short.valueOf("1")));
26 assertEquals(one, generator.convert(Integer.valueOf("1")));