a35b9ed91749266fc1cd46ca956acba1a3a581bb
[yangtools.git] / codec / yang-data-codec-binfmt / src / test / java / org / opendaylight / yangtools / yang / data / codec / binfmt / BooleanSerializationTest.java
1 /*
2  * Copyright (c) 2019 PANTHEON.tech, s.r.o. 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.yang.data.codec.binfmt;
9
10 import java.util.Arrays;
11 import org.junit.Test;
12 import org.junit.runner.RunWith;
13 import org.junit.runners.Parameterized;
14 import org.junit.runners.Parameterized.Parameter;
15 import org.junit.runners.Parameterized.Parameters;
16
17 @RunWith(Parameterized.class)
18 public class BooleanSerializationTest extends AbstractSerializationTest {
19     @Parameters(name = "{0}")
20     public static Iterable<Object[]> data() {
21         return Arrays.asList(
22             new Object[] { NormalizedNodeStreamVersion.NEON_SR2,   99 },
23             new Object[] { NormalizedNodeStreamVersion.SODIUM_SR1, 96 },
24             new Object[] { NormalizedNodeStreamVersion.MAGNESIUM,  96 });
25     }
26
27     @Parameter(1)
28     public int size;
29
30     @Test
31     public void testTrue() {
32         assertEquals(Boolean.TRUE, size);
33     }
34
35     @Test
36     public void testFalse() {
37         assertEquals(Boolean.FALSE, size);
38     }
39 }