Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
KSP.Testing.UnitTest Class Reference

See /KSPExternalModules/UnitTests for a sample UnitTest. Output is in the log. More...

Public Member Functions

virtual void TestStartUp ()
 
virtual void TestTearDown ()
 
 UnitTest ()
 

Public Attributes

List< TestStateResults = new List<TestState>()
 

Protected Member Functions

void assertEquals (string testname, object value, object shouldbe)
 Make sure that value and object are equal. More...
 

Detailed Description

See /KSPExternalModules/UnitTests for a sample UnitTest. Output is in the log.

Inherit this class for each class and create methods with the TestInfo attribute for each individual test. It's crappy, but since NUnit doesn't like Unity, this'll do for now.

Constructor & Destructor Documentation

KSP.Testing.UnitTest.UnitTest ( )
inline

Member Function Documentation

void KSP.Testing.UnitTest.assertEquals ( string  testname,
object  value,
object  shouldbe 
)
inlineprotected

Make sure that value and object are equal.

Parameters
testnameDisplayed name of the test
valueValue to be tested
shouldbeExpected value

< Vector3ds are a damn nightmare.

< As for everything else, just use the .Equals() method.

virtual void KSP.Testing.UnitTest.TestStartUp ( )
inlinevirtual
virtual void KSP.Testing.UnitTest.TestTearDown ( )
inlinevirtual

Member Data Documentation

List<TestState> KSP.Testing.UnitTest.Results = new List<TestState>()

The documentation for this class was generated from the following file: