Package testcases

Source Code of testcases.AddIntegerDictsTestCase

package testcases;

import org.junit.Test;
import org.junit.Assert;

import com.example.types.ABIntegerDict;

public class AddIntegerDictsTestCase extends TestServiceTestCase {

    @Test
    public void test_null_args() throws Exception {
        ABIntegerDict r = port.add_integer_dicts(null, null);
        Assert.assertEquals((long)0, (long)r.getA());
        Assert.assertEquals((long)0, (long)r.getB());
    }

    @Test
    public void test_notset() throws Exception {
        ABIntegerDict p = new ABIntegerDict();
        ABIntegerDict q = new ABIntegerDict();
        ABIntegerDict r = port.add_integer_dicts(p, q);
        Assert.assertEquals((long)0, (long)r.getA());
        Assert.assertEquals((long)0, (long)r.getB());
    }

    @Test
    public void test_null() throws Exception {
        ABIntegerDict p = new ABIntegerDict(null, null);
        ABIntegerDict q = new ABIntegerDict(null, null);
        ABIntegerDict r = port.add_integer_dicts(p, q);
        Assert.assertEquals((long)0, (long)r.getA());
        Assert.assertEquals((long)0, (long)r.getB());
    }

    @Test
    public void test_empty() throws Exception {
        ABIntegerDict p = new ABIntegerDict(0, 0);
        ABIntegerDict q = new ABIntegerDict(0, 0);
        ABIntegerDict r = port.add_integer_dicts(p, q);
        Assert.assertEquals((long)0, (long)r.getA());
        Assert.assertEquals((long)0, (long)r.getB());
    }

    @Test
    public void test() throws Exception {
        ABIntegerDict p = new ABIntegerDict(100, 50);
        ABIntegerDict q = new ABIntegerDict(50, 25);
        ABIntegerDict r = port.add_integer_dicts(p, q);
        Assert.assertEquals((long)150, (long)r.getA());
        Assert.assertEquals((long)75, (long)r.getB());
    }
}
TOP

Related Classes of testcases.AddIntegerDictsTestCase

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.