public void GetGlobalOptionSetMetadata() { OrganizationRequest orgReq = null; Guid respId = Guid.NewGuid(); MRetrieveOptionSetResponse resp = new MRetrieveOptionSetResponse(); resp.BehaveAsDefaultValue(); resp.OptionSetMetadataGet = () => { return(new OptionSetMetadata()); }; MRetrieveResponse Rresp = new MRetrieveResponse(); Rresp.EntityGet = () => new Entity(); Microsoft.Xrm.Sdk.Metadata.OptionSetMetadata M = null; BCrmServiceClient.AddResponse(typeof(RetrieveOptionSetRequest), resp); BCrmServiceClient.AddResponse(typeof(RetrieveRequest), Rresp); BCrmServiceClient.MockCrmCommandExecute(); M = crmaction.GetGlobalOptionSetMetadata("online"); orgReq = BCrmServiceClient.GetRequest(typeof(RetrieveOptionSetRequest)); Assert.IsNotNull(((RetrieveOptionSetRequest)orgReq).Name); }
public void GetEntityDataByIdTest() { OrganizationRequest orgReq = null; Guid respId = Guid.NewGuid(); Dictionary <string, object> MapData = null; MRetrieveResponse updResp = new MRetrieveResponse(); updResp.EntityGet = () => new Entity(); BCrmServiceClient.AddResponse(typeof(RetrieveRequest), updResp); BCrmServiceClient.MockCrmCommandExecute(); List <string> fldList = new List <string>(); fldList.Add("name"); fldList.Add("source"); fldList.Add("importmapid"); MapData = crmaction.GetEntityDataById("account", respId, fldList); Assert.IsNotNull(MapData); orgReq = BCrmServiceClient.GetRequest(typeof(RetrieveRequest)); Assert.IsNotNull(((RetrieveRequest)orgReq).ColumnSet); }