blob: 060a90eda5e0d55e78f3394d2b81bfbc690583f9 [file] [log] [blame]
package co.nstant.in.cbor;
import java.io.ByteArrayOutputStream;
import org.junit.Before;
import org.junit.Test;
import co.nstant.in.cbor.model.DataItem;
import co.nstant.in.cbor.model.MajorType;
public class CborEncoderTest {
private class InvalidDataItem extends DataItem {
public InvalidDataItem() {
super(MajorType.INVALID);
}
}
private CborEncoder encoder;
@Before
public void setup() {
encoder = new CborEncoder(new ByteArrayOutputStream());
}
@Test(expected = CborException.class)
public void shouldNotEncodeInvalidMajorType() throws CborException {
encoder.encode(new InvalidDataItem());
}
}