"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Test_1 = require("../Test");
const Types_1 = require("../../../Types");
const FieldHelpers_1 = require("./FieldHelpers");
describe('FieldHelpers', () => {
    it('generateFieldAccessor', () => {
        expect(Test_1.printTsNode(FieldHelpers_1.generateFieldAccessor({
            Type: Types_1.mockIl2CppTypeInfo({ Namespace: 'System', TypeName: 'CString', Indirection: 1 }),
            Name: 'title',
            Offset: 0x8,
        }, Test_1.fakeContext, undefined, false))).toMatchInlineSnapshot(`
      "public get title(): System.CString {
          return this.readField(8, System.CString, 1);
      }"
    `);
    });
    it('generateFieldAccessor(pointer)', () => {
        expect(Test_1.printTsNode(FieldHelpers_1.generateFieldAccessor({
            Type: Types_1.mockIl2CppTypeInfo({ Namespace: 'System', TypeName: 'CString', Indirection: 2 }),
            Name: 'title',
            Offset: 0x8,
        }, Test_1.fakeContext, undefined, false))).toMatchInlineSnapshot(`
      "public get title(): System.CString {
          return this.readField(8, System.CString, 2);
      }"
    `);
    });
    it('generateFieldAccessor(primitive)', () => {
        expect(Test_1.printTsNode(FieldHelpers_1.generateFieldAccessor({
            Type: Types_1.mockIl2CppTypeInfo({ TypeName: 'int32_t', IsPrimitive: true, Indirection: 1 }),
            Name: 'title',
            Offset: 0x8,
        }, Test_1.fakeContext, undefined, false))).toMatchInlineSnapshot(`
      "public get title(): number {
          return this.readTypePrimitive(8, \\"int32_t\\", 1);
      }"
    `);
    });
    it('static generateFieldAccessor(primitive)', () => {
        expect(Test_1.printTsNode(FieldHelpers_1.generateFieldAccessor({
            Type: Types_1.mockIl2CppTypeInfo({ TypeName: 'int32_t', IsPrimitive: true, Indirection: 1 }),
            Name: 'title',
            Offset: 0x8,
        }, Test_1.fakeContext, undefined, true))).toMatchInlineSnapshot(`
      "public static get title(): number {
          return this.readTypePrimitive(8, \\"int32_t\\", 1);
      }"
    `);
    });
});
//# sourceMappingURL=FieldHelpers.test.js.map