38 lines
1.1 KiB
Java
38 lines
1.1 KiB
Java
//CipherStreamJava/src/test/java/com/mattrixwv/cipherstream/exceptions/TestInvalidBaseException.java
|
|
//Mattrixwv
|
|
// Created: 04-14-23
|
|
//Modified: 04-14-23
|
|
package com.mattrixwv.cipherstream.exceptions;
|
|
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
import static org.junit.jupiter.api.Assertions.assertNull;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
|
|
public class TestInvalidBaseException{
|
|
private String message = "message";
|
|
private Throwable cause = new Exception();
|
|
|
|
|
|
@Test
|
|
public void testConstructors(){
|
|
InvalidBaseException exception = new InvalidBaseException();
|
|
assertNull(exception.getMessage());
|
|
assertNull(exception.getCause());
|
|
|
|
exception = new InvalidBaseException(message);
|
|
assertEquals(message, exception.getMessage());
|
|
assertNull(exception.getCause());
|
|
|
|
exception = new InvalidBaseException(cause);
|
|
assertEquals(cause.toString(), exception.getMessage());
|
|
assertEquals(cause, exception.getCause());
|
|
|
|
exception = new InvalidBaseException(message, cause);
|
|
assertEquals(message, exception.getMessage());
|
|
assertEquals(cause, exception.getCause());
|
|
}
|
|
}
|