import { AttributeMock , AttributeReturnType } from "../attributes/attribute/attribute.mock" ; import { ItemCollectionMock } from "../collection/itemcollection/itemcollection.mock" ; import { ControlMock } from "../controls/control/control.mock" ; export class DataMock implements Xrm . Data { public attributes : ItemCollectionMock < AttributeMock < ControlMock , AttributeReturnType > > ; public entity : Xrm . Entity ; public process : Xrm . ProcessFlow . ProcessManager ; public loadEventHandlers : Xrm . Events . ContextSensitiveHandler [ ] ; constructor ( entity , process ? ) { this . attributes = new ItemCollectionMock ( ) ; this . entity = entity ; this . process = process ; this . loadEventHandlers = [ ] ; } public refresh ( save ) { throw new Error ( ( "refresh not implemented" ) ) ; } public save ( saveOptions ? ) { throw new Error ( ( "save not implemented" ) ) ; } public isValid ( ) { throw new Error ( ( "isValid not implemented" ) ) ; } public getIsDirty ( ) { throw new Error ( ( "getIsDirty not implemented" ) ) ; } public addOnLoad ( handler ) { this . loadEventHandlers . push ( handler ) ; } public removeOnLoad ( handler ) { const index = this . loadEventHandlers . indexOf ( handler ) ; this . loadEventHandlers . splice ( index ) ; } }