"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Name_1 = require("@wireio/sdk-core/chain/Name");
const Integer_1 = require("@wireio/sdk-core/chain/Integer");
describe("Name", () => {
    test("Name.from creates a valid name", () => {
        const name = Name_1.Name.from("sysio");
        expect(name).toBeInstanceOf(Name_1.Name);
    });
    test("toString returns the name string", () => {
        expect(Name_1.Name.from("sysio").toString()).toBe("sysio");
    });
    test("equals returns true for matching string", () => {
        expect(Name_1.Name.from("sysio").equals("sysio")).toBe(true);
    });
    test("equals returns true for matching Name instance", () => {
        expect(Name_1.Name.from("sysio").equals(Name_1.Name.from("sysio"))).toBe(true);
    });
    test("equals returns false for different name", () => {
        expect(Name_1.Name.from("sysio").equals("other")).toBe(false);
    });
    test("empty name has empty toString", () => {
        const name = Name_1.Name.from("");
        expect(name.toString()).toBe("");
    });
    test("valid name patterns", () => {
        expect(Name_1.Name.from("a").toString()).toBe("a");
        expect(Name_1.Name.from("abcde12345").toString()).toBe("abcde12345");
        expect(Name_1.Name.from("a.b.c").toString()).toBe("a.b.c");
    });
    test("Name.from with UInt64 numeric value", () => {
        const original = Name_1.Name.from("sysio");
        const fromUint = Name_1.Name.from(original.value);
        expect(fromUint.toString()).toBe("sysio");
    });
    test("Name.from with UInt64.from(0) creates empty name", () => {
        const name = Name_1.Name.from(Integer_1.UInt64.from(0));
        expect(name.toString()).toBe("");
    });
});
//# sourceMappingURL=Name.test.js.map