/// /// @file TestXMLErrorC.cs /// @brief XMLError unit tests, C version /// @author Frank Bergmann (Csharp conversion) /// @author Akiya Jouraku (Csharp conversion) /// @author Sarah Keating /// /// $Id: TestXMLErrorC.cs 8704 2009-01-04 02:26:05Z mhucka $ /// $HeadURL: https://sbml.svn.sourceforge.net/svnroot/sbml/trunk/libsbml/src/bindings/csharp/test/xml/TestXMLErrorC.cs $ /// /// This test file was converted from src/sbml/test/TestXMLErrorC.c /// with the help of conversion sciprt (ctest_converter.pl). /// /// */ namespace LibSBMLCSTest { using libsbml; using System.IO; public class TestXMLErrorC { public class AssertionError : System.Exception { public AssertionError() : base() { } } static void assertTrue(bool condition) { if (condition == true) { return; } throw new AssertionError(); } static void assertEquals(object a, object b) { if ( (a == null) && (b == null) ) { return; } else if (a.Equals(b)) { return; } throw new AssertionError(); } static void assertNotEquals(object a, object b) { if ( (a == null) && (b == null) ) { throw new AssertionError(); } else if (a.Equals(b)) { throw new AssertionError(); } } static void assertEquals(bool a, bool b) { if ( a == b ) { return; } throw new AssertionError(); } static void assertNotEquals(bool a, bool b) { if ( a != b ) { return; } throw new AssertionError(); } static void assertEquals(int a, int b) { if ( a == b ) { return; } throw new AssertionError(); } static void assertNotEquals(int a, int b) { if ( a != b ) { return; } throw new AssertionError(); } public void test_XMLError_create_C() { XMLError error = new XMLError(); assertTrue( error != null ); assertTrue( error.isInfo() == false ); assertTrue( error.isWarning() == false ); assertTrue( error.isError() == false ); assertTrue( error.isFatal() == true ); error = null; error = new XMLError(12345, "My message"); assertTrue( ( "My message" != error.getMessage() ) == false ); assertTrue( error.getErrorId() == 12345 ); error = null; } } }