Initial commit
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
package com.mattrixwv.cipherstream.exception;
|
||||
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.junit.jupiter.MockitoExtension;
|
||||
|
||||
|
||||
@Tag("unit-test")
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
public class InvalidCipherParameterExceptionTest{
|
||||
//Fields
|
||||
private String message = "Error Message";
|
||||
private Throwable cause = new Throwable();
|
||||
|
||||
|
||||
@Test
|
||||
public void testConstructor_default(){
|
||||
InvalidCipherParameterException exception = new InvalidCipherParameterException();
|
||||
|
||||
assertNull(exception.getMessage());
|
||||
assertNull(exception.getCause());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConstructor_message(){
|
||||
InvalidCipherParameterException exception = new InvalidCipherParameterException(message);
|
||||
|
||||
assertEquals(message, exception.getMessage());
|
||||
assertNull(exception.getCause());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConstructor_cause(){
|
||||
InvalidCipherParameterException exception = new InvalidCipherParameterException(cause);
|
||||
|
||||
assertEquals(cause.toString(), exception.getMessage());
|
||||
assertEquals(cause, exception.getCause());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConstructor_messageCause(){
|
||||
InvalidCipherParameterException exception = new InvalidCipherParameterException(message, cause);
|
||||
|
||||
assertEquals(message, exception.getMessage());
|
||||
assertEquals(cause, exception.getCause());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user