Skip to content

Commit

Permalink
Add TestWPISuiteException
Browse files Browse the repository at this point in the history
100% code coverage
  • Loading branch information
robertsmieja committed Sep 4, 2014
1 parent ac1971c commit 04c8eca
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class WPISuiteException extends Exception {
/**
*
*/
private static final long serialVersionUID = -5271354512939175980L;
protected static final long serialVersionUID = -5271354512939175980L;

/**
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package edu.wpi.cs.wpisuitetng.exceptions;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

import javax.servlet.http.HttpServletResponse;

import org.junit.Test;

public class TestWPISuiteException {

@Test
public void testConstructor() {
WPISuiteException exception = new WPISuiteException();

assertNotNull(exception);
assertNull(exception.getMessage());
}

@Test
public void testConstructorWithMessage() {
WPISuiteException exception = new WPISuiteException("TestException");

assertNotNull(exception);
assertEquals("TestException", exception.getMessage());
}

@Test
public void testGetStatus(){
WPISuiteException exception = new WPISuiteException();

assertEquals(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, exception.getStatus());
}

@Test
public void testSerialVersionUID() {
assertEquals(-5271354512939175980L, WPISuiteException.serialVersionUID);
}
}

0 comments on commit 04c8eca

Please sign in to comment.