@itwin/presentation-testing
Version:
Testing utilities for iTwin.js Presentation library
42 lines • 1.56 kB
JavaScript
;
/*---------------------------------------------------------------------------------------------
* 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
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.TestIModelBuilderImpl = void 0;
const core_common_1 = require("@itwin/core-common");
/**
* Default implementation of the IModel builder interface.
* @internal
*/
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 core_common_1.Code({ spec: codeSpec.id, scope: scopeModelId, value: codeValue });
}
async importSchema(schemaXml) {
await this._iModel.importSchemaStrings([schemaXml]);
}
}
exports.TestIModelBuilderImpl = TestIModelBuilderImpl;
//# sourceMappingURL=IModelBuilderImpl.js.map