var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define(["require", "exports"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    class Assert {
        static equals(expected, result, msg) {
            if (result !== expected) {
                Assert.throw(msg || `Expected ${expected}, found ${result}`);
            }
        }
        static doesNotEqual(expected, result, msg) {
            if (result === expected) {
                Assert.throw(msg || `Not Expected ${expected}, found ${result}`);
            }
        }
        static throws(expected, f, msg) {
            try {
                f();
                Assert.throw(msg || `Expected ${expected}, no exception was thrown.`);
            }
            catch (e) {
                if (e.message !== expected) {
                    Assert.throw(msg || `Expected error ${expected}, found ${e.message}`);
                }
            }
        }
        static throwsAsync(expected, f, msg) {
            return __awaiter(this, void 0, void 0, function* () {
                try {
                    yield f();
                    Assert.throw(msg || `Expected ${expected}, no exception was thrown.`);
                }
                catch (e) {
                    if (e.message !== expected) {
                        Assert.throw(msg || `Expected error ${expected}, found ${e.message}`);
                    }
                }
            });
        }
        static isTrue(b, msg) {
            if (b !== true) {
                Assert.throw(msg || "Expected isTrue");
            }
        }
        static isFalse(b, msg) {
            if (b !== false) {
                Assert.throw(msg || "Expected isFalse");
            }
        }
        static isNull(a, msg) {
            if (a !== null) {
                Assert.throw(msg || `Expected null found ${a}`);
            }
        }
        static isUndefined(a, msg) {
            if (a !== undefined) {
                Assert.throw(msg || `Expected undefined found ${a}`);
            }
        }
        static isEmpty(a, msg) {
            if (a) {
                Assert.throw(msg || `Expected empty found ${a}`);
            }
        }
        static isNotNull(a, msg) {
            if (a === null) {
                Assert.throw(msg || `Expected not null found ${a}`);
            }
        }
        static isNotUndefined(a, msg) {
            if (a === undefined) {
                Assert.throw(msg || `Expected not undefined found ${a}`);
            }
        }
        static isNotEmpty(a, msg) {
            if (!a) {
                Assert.throw(msg || `Expected not empty found ${a}`);
            }
        }
        static throw(message) {
            throw new Error(`Assertion Failed, ${message}`);
        }
    }
    exports.default = Assert;
});
//# sourceMappingURL=Assert.js.map