UNPKG

@drozdik.m/unit-test

Version:

Unit test with test cases with Assert functions. Simple and easy.

50 lines (49 loc) 1.53 kB
exports.__esModule = true; var TestCase = /** @class */ (function () { //-------------------------------------------------- //----------CONSTRUCTOR----------------------------- //-------------------------------------------------- /** * Creates new instance of TestCase * @param name Name of the test case * @param useCaseFunction Function to run */ function TestCase(name, useCaseFunction) { //-------------------------------------------------- //----------PROPERTIES------------------------------ //-------------------------------------------------- this.name = ""; this.error = null; this.success = false; this.useCaseFunction = null; this.isDone = false; this.name = name; this.useCaseFunction = useCaseFunction; } /** * Returns error is some caught, else null * */ TestCase.prototype.Error = function () { return this.error; }; /** * Returns true if test case ran successfully * */ TestCase.prototype.Success = function () { return this.success; }; /** * Returns true if the test is done, else false * */ TestCase.prototype.IsDone = function () { return this.isDone; }; /** * Returns name of this test case * */ TestCase.prototype.Name = function () { return this.name; }; return TestCase; }()); exports.TestCase = TestCase;