UNPKG

@itwin/presentation-testing

Version:

Testing utilities for iTwin.js Presentation library

38 lines 1.37 kB
/*--------------------------------------------------------------------------------------------- * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ /** @packageDocumentation * @module IModel */ import { Code } from "@itwin/core-common"; /** * Default implementation of the IModel builder interface. * @internal */ export class TestIModelBuilderImpl { _iModel; constructor(iModel) { this._iModel = iModel; } insertModel(props) { return this._iModel.models.insertModel(props); } insertElement(props) { return this._iModel.elements.insertElement(props); } insertAspect(props) { return this._iModel.elements.insertAspect(props); } insertRelationship(props) { return this._iModel.relationships.insertInstance(props); } createCode(scopeModelId, codeSpecName, codeValue) { const codeSpec = this._iModel.codeSpecs.getByName(codeSpecName); return new Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue }); } async importSchema(schemaXml) { await this._iModel.importSchemaStrings([schemaXml]); } } //# sourceMappingURL=IModelBuilderImpl.js.map