Update error messages and test names

This commit is contained in:
2024-04-19 22:36:52 -04:00
parent 434260969c
commit 0b1d5a3d91
46 changed files with 395 additions and 520 deletions

View File

@@ -0,0 +1,45 @@
//CipherStreamJava/src/test/java/com/mattrixwv/cipherstream/exception/TestInvalidInputException.java
//Mattrixwv
// Created: 04-14-23
//Modified: 04-19-24
package com.mattrixwv.cipherstream.exceptions;
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
public class InvalidInputExceptionTest{
private String message = "message";
private Throwable cause = new Exception();
@Test
public void testConstructor_default(){
InvalidInputException exception = new InvalidInputException();
assertNull(exception.getMessage());
assertNull(exception.getCause());
}
@Test
public void testConstructor_message(){
InvalidInputException exception = new InvalidInputException(message);
assertEquals(message, exception.getMessage());
assertNull(exception.getCause());
}
@Test
public void testConstructor_cause(){
InvalidInputException exception = new InvalidInputException(cause);
assertEquals(cause.toString(), exception.getMessage());
assertEquals(cause, exception.getCause());
}
@Test
public void testConstructor_messageAndCause(){
InvalidInputException exception = new InvalidInputException(message, cause);
assertEquals(message, exception.getMessage());
assertEquals(cause, exception.getCause());
}
}