salesforce rest api test class
上一篇文章(salesforce rest api demo)我们写到salesforce如何写rest api,这篇我们将写如何写test class@isTest(SeeAllData=true)public class Api_user_profileTest{ static testMethod void Api_user_profileTest() { system.debug('start...'); Test.startTest(); String ReturnCode = ''; RestContext.request = new RestRequest(); RestContext.response = new RestResponse(); RestContext.request.requestURI = '/services/apexrest/user/p...
salesforce rest api demo
////api getPersonBasicInformation//by bruce he@RestResource(urlMapping='/user/profile/*') global with sharing class Api_user_profile{ @HttpGet global static void getPersonBasicInformation() { RestResponse res = RestContext.response; res.addHeader('Content-Type', 'application/json'); //return result obj PersonBasicInformation model = new PersonBasicInformation(); try{ ...
C#/.NET请求salesforce restful api示例
先在salesforce里写一个restful api:@RestResource(urlMapping='/user/*') global with sharing class Api_user_profile{ @HttpGet global static String getPersonBasicInformation() { List<Account> accList = DataBase.query('SELECT id,name FROM Account limit ' + Integer.valueOf(Math.floor(Math.random() * 10 + 1))); return JSON.serialize(accList); }}再在c#/.net里调用salesforce restful api:using System;using System.Collec...
quartz.net demo
TaskJobDemo public class TimeJob : IJob { public void Execute(IJobExecutionContext context) { //向c:\Quartz.txt写入当前时间并换行 System.IO.File.AppendAllText(AppDomain.CurrentDomain.BaseDirectory + "Quartz.txt", DateTime.Now + Environment.NewLine); } } class Program { static void Main(string[] args) { //1、创建一个调度器 var factory = new StdSchedu...
区块链实现简易比特币C#.NET版
using System.Collections; using System; using static System.Console; //简易区块链 namespace test { //区块 public class Block { //基本属性:上一个区块的Hash值,交易信息,Nonce变量,当前区块的Hash private int previousBlockHashCode; private string transactionInfo; private string nonce; private int blockHashCode; //构造函数 public Block() { ...
区块链demo C#.NET版
原文链接:https://www.cnblogs.com/myzony/p/8478789.html文章原文来自:Code your own blockchain in less than 200 lines of Go!,原始文章是通过 Go 语言来实现自己的区块链的,这里我们参照该文章来使用 C# + Asp.Net Core 实现自己的区块链。在这里我也参考了 这篇译文 。区块链网络相关原始文章已经更新,请查看 这里。1.项目配置首先新建一个 Asp.Net Core 项目,然后选择 Empty Project(空项目) 类型,建立完成后无需进行任何配置。2.数据模型这里我们来创建一个具体的区块数据模型,使用的是 Struc...
lucene.net demo
Lucene.net是Lucene的.net移植版本,是一个开源的全文检索引擎开发包,即它不是一个完整的全文检索引擎,而是一个全文检索引擎的架构,提供了完整的查询引擎和索引引擎。开发人员可以基于Lucene.net实现全文检索的功能。Lucene.net是Apache软件基金会赞助的开源项目,基于Apache License协议。Lucene.net并不是一个爬行搜索引擎,也不会自动地索引内容。我们得先将要索引的文档中的文本抽取出来,然后再将其加到Lucene.net索引中。标准的步骤是先初始化一个Analyzer、打开一个IndexWriter、然后再将文档...
程序员防猝死指南——程序员养生攻略
程序员在其职业生涯中,健康问题尤为突出。但是大部分程序员只顾码字,却往往忽略了自身的健康问题。这或许是因为写代码太入神,也或许是因为来自老板的压力太大。但这些并不是你折磨自己最好的理由,我们程序员也需要养生,只有懂得养生,才能更好地编程。程序员都有哪些健康问题这里罗列了 9 大程序员职业病,你也可以对号入座,如果你找不到座位,那么恭喜你,你是一个合格的程序员。腕部疼痛(重复性劳损)盯着看移动的打印进度以及其后的句点造成的眼部问题姿势不当造成的背部不适,尤其是背下侧,肩上...