mirror of
https://github.com/ethauvin/JSON-java.git
synced 2025-06-17 16:00:51 -07:00
added complete tests
This commit is contained in:
parent
fd0d1156d4
commit
48dccd91e7
20 changed files with 8871 additions and 935 deletions
35
tests/TestJSONException.java
Normal file
35
tests/TestJSONException.java
Normal file
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* File: TestJSONException.java Author: JSON.org
|
||||
*/
|
||||
package org.json.tests;
|
||||
|
||||
import org.json.JSONException;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
/**
|
||||
* The Class TestJSONException.
|
||||
*/
|
||||
public class TestJSONException extends TestCase {
|
||||
|
||||
/** The jsonexception. */
|
||||
JSONException jsonexception;
|
||||
|
||||
/**
|
||||
* Tests the constructor method using string.
|
||||
*/
|
||||
public void testConstructor_String() {
|
||||
jsonexception = new JSONException("test String");
|
||||
assertEquals("test String", jsonexception.getMessage());
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the constructor method using exception.
|
||||
*/
|
||||
public void testConstructor_Exception() {
|
||||
Exception e = new Exception();
|
||||
jsonexception = new JSONException(e);
|
||||
assertEquals(e, jsonexception.getCause());
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue