text: // SparkleXrm.UnitTests.js
  (function(){
  Type.registerNamespace('SparkleXrm.UnitTests');SparkleXrm.UnitTests.LocalisationTests=function(){}
  SparkleXrm.UnitTests.LocalisationTests.prototype={NumberParse:function(){var $0={};$0.decimalSymbol=',';$0.numberSepartor='.';debugger;var $1=SparkleXrm.NumberEx.parse('22,10',$0);QUnit.equal($1,22.1);var $2=SparkleXrm.NumberEx.parse('1.022,10',$0);QUnit.equal($2,1022.1);return true;}}
  SparkleXrm.UnitTests.MetadataQueryTests=function(){}
  SparkleXrm.UnitTests.MetadataQueryTests.prototype={queryAllMetaData:function(){var $0=new SparkleXrm.Sdk.Messages.RetrieveMetadataChangesRequest();$0.query={};$0.query.criteria={};$0.query.criteria.filterOperator='Or';$0.query.criteria.conditions=[];var $1={};$1.conditionOperator='Equals';$1.propertyName='LogicalName';$1.value='account';$0.query.criteria.conditions.add($1);$0.query.properties={};$0.query.properties.propertyNames=['Attributes'];var $2={};$2.properties={};$2.properties.propertyNames=['OptionSet'];$0.query.attributeQuery=$2;var $3={};$2.criteria=$3;$3.filterOperator='And';$3.conditions=[];var $4=SparkleXrm.Sdk.OrganizationServiceProxy.execute($0);return true;},queryNameAttributeForAccount:function(){var $0=new SparkleXrm.Sdk.Metadata.Query.MetadataQueryBuilder();$0.addEntities(['account'],['PrimaryNameAttribute']);var $1=SparkleXrm.Sdk.OrganizationServiceProxy.execute($0.request);QUnit.equal($1.entityMetadata[0].primaryNameAttribute,'name');return true;},queryAttributeDisplayNamesForTwoEntities:function(){var $0=new SparkleXrm.Sdk.Metadata.Query.MetadataQueryBuilder();$0.addEntities(['account','contact'],['Attributes','DisplayName','DisplayCollectionName']);$0.addAttributes(['name','firstname','statecode','statuscode'],['DisplayName']);var $1=SparkleXrm.Sdk.OrganizationServiceProxy.execute($0.request);return true;},queryOneToManyRelationship:function(){var $0=new SparkleXrm.Sdk.RetrieveRelationshipRequest();$0.name='contact_customer_accounts';$0.retrieveAsIfPublished=true;var $1=SparkleXrm.Sdk.OrganizationServiceProxy.execute($0);var $2=$1.relationshipMetadata;QUnit.equal($2.isCustomRelationship,false);QUnit.equal($2.schemaName,'contact_customer_accounts');QUnit.equal($2.referencedAttribute,'accountid');return true;},queryManyToManyRelationship:function(){var $0=new SparkleXrm.Sdk.RetrieveRelationshipRequest();$0.name='accountleads_association';$0.retrieveAsIfPublished=true;var $1=SparkleXrm.Sdk.OrganizationServiceProxy.execute($0);var $2=$1.relationshipMetadata;QUnit.equal($2.isCustomRelationship,false);QUnit.equal($2.schemaName,'accountleads_association');QUnit.equal($2.intersectEntityName,'accountleads');return true;}}
  SparkleXrm.UnitTests.OrganizationServiceProxyTests=function(){}
  SparkleXrm.UnitTests.OrganizationServiceProxyTests.prototype={crudTests:function(){var $0=Date.get_now().toISOString()+Date.get_now().toTimeString();var $1=new SparkleXrm.Sdk.Entity('contact');$1.setAttributeValue('lastname','Test Contact1 '+$0);$1.id=SparkleXrm.Sdk.OrganizationServiceProxy.create($1).toString();var $2=new SparkleXrm.Sdk.Entity('contact');$2.setAttributeValue('lastname','Test Contact2 '+$0);$2.id=SparkleXrm.Sdk.OrganizationServiceProxy.create($2).toString();var $3=new SparkleXrm.Sdk.Entity('activityparty');$3.setAttributeValue('partyid',$1.toEntityReference());var $4=[];SparkleXrm.ArrayEx.add($4,$3);var $5=new SparkleXrm.Sdk.Entity('email');$5.setAttributeValue('to',new SparkleXrm.Sdk.EntityCollection($4));$5.setAttributeValue('subject','Unit Test email '+$0);$5.setAttributeValue('id',SparkleXrm.Sdk.OrganizationServiceProxy.create($5));$5.id=$5.getAttributeValue('id').toString();var $6=SparkleXrm.Sdk.OrganizationServiceProxy.retrieve('email',$5.id,['to','subject']);var $7=$6.getAttributeValue('to');var $8=new SparkleXrm.Sdk.Entity('activityparty');$8.setAttributeValue('partyid',$2.toEntityReference());var $9=$7.get_entities().items();SparkleXrm.ArrayEx.add($9,$8);SparkleXrm.Sdk.OrganizationServiceProxy.update($6);SparkleXrm.Sdk.OrganizationServiceProxy.delete_($5.logicalName,new SparkleXrm.Sdk.Guid($5.id));SparkleXrm.Sdk.OrganizationServiceProxy.delete_($1.logicalName,new SparkleXrm.Sdk.Guid($1.id));SparkleXrm.Sdk.OrganizationServiceProxy.delete_($2.logicalName,new SparkleXrm.Sdk.Guid($2.id));return true;}}
  SparkleXrm.UnitTests.LocalisationTests.registerClass('SparkleXrm.UnitTests.LocalisationTests');SparkleXrm.UnitTests.MetadataQueryTests.registerClass('SparkleXrm.UnitTests.MetadataQueryTests');SparkleXrm.UnitTests.OrganizationServiceProxyTests.registerClass('SparkleXrm.UnitTests.OrganizationServiceProxyTests');})();// This script was generated using Script# v0.7.4.0
  