"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var browserHashService_1 = require("../../partial-src/service/browserHashService");
function run() {
    var interval = 500;
    var initHash = window.location.hash;
    var service = new browserHashService_1.BrowserHashService();
    describe("Test browserHas service", function () {
        it("set test", function () {
            service.set("a", "1");
            service.set("b", "2");
            var geta = service.get("a");
            if (geta !== "1") {
                throw new Error("Set hash error");
            }
            var getb = service.get("b");
            if (getb !== "2") {
                throw new Error("Set hash error");
            }
            if (window.location.hash.toString() !== "#a=1&b=2") {
                throw new Error("Set Error");
            }
            service.unset("b");
            var unsetb = service.get("b");
            if (unsetb) {
                throw new Error("unset Error");
            }
            if (window.location.hash.toString() !== "#a=1") {
                throw new Error("");
            }
        });
        it("syncfromhahs", function () {
            service.syncFromHash("");
            if (window.location.hash.toString() !== "") {
                throw new Error("syncFromHash''  is Error");
            }
            service.syncFromHash("#a=1&b=2");
            if (window.location.hash.toString() !== "#a=1&b=2") {
                throw new Error("syncFromHash'#...'  is Error");
            }
            var geta = service.get("a");
            if (geta !== "1") {
                throw new Error("Set hash error With syncFromHash");
            }
            var getb = service.get("b");
            if (getb !== "2") {
                throw new Error("Set hash error With syncFromHash");
            }
            service.syncFromHash("a=1&b=2");
            if (window.location.hash.toString() !== "#a=1&b=2") {
                throw new Error("syncFromHash'...'  is Error");
            }
            var geta2 = service.get("a");
            if (geta2 !== "1") {
                throw new Error("Set hash error With syncFromHash");
            }
            var getb2 = service.get("b");
            if (getb2 !== "2") {
                throw new Error("Set hash error With syncFromHash");
            }
            window.location.hash = initHash;
        });
    });
}
exports.run = run;
//# sourceMappingURL=browserHashService.test.js.map