package de.ctdo.bunti.dmx;

import org.junit.Before;
import org.junit.Test;

import static junit.framework.Assert.*;

/**
 * @author: lucas
 * @date: 07.03.12 21:47
 */
public class DMXChannelTest {
    DMXChannel dut;

    @Before
    public void setUp() throws Exception {
        dut = new DMXChannel(23, "testchannel");
    }

    @Test
    public void testGetValue1() throws Exception {
        assertEquals(0, dut.getValue());
    }

    @Test
    public void testGetValue2() throws Exception {
        dut.setValue(111);
        assertEquals(111, dut.getValue());
    }

    @Test
    public void testGetOffset() throws Exception {
        assertEquals(23, dut.getOffset());
    }

    @Test
    public void testSetOffset() throws Exception {
        dut.setOffset(44);
        assertEquals(44, dut.getOffset());
    }

    @Test
    public void testGetName() throws Exception {
        assertEquals("testchannel", dut.getName());
    }

    @Test
    public void testSetName() throws Exception {
        dut.setName("rapantel");
        assertEquals("rapantel", dut.getName());
    }

    @Test
    public void testToString() throws Exception {
        assertEquals("DMXChannel testchannel,23,0", dut.toString());
    }
}
