本文整理汇总了C#中ClusterConfig类的典型用法代码示例。如果您正苦于以下问题:C#ClusterConfig类的具体用法?C#ClusterConfig怎么用?C#ClusterConfig使用的例子?这里精选的类代码示例或许可以为您提供帮助。
示例1:GetClusterList
publicasyncTaskGetClusterList()
{
ClusterConfigconfig=newClusterConfig();
MockReliableStateManagerstateManager=newMockReliableStateManager();
ClusterServicetarget=newClusterService(null,null,newMockApplicationDeployService(),stateManager,this.CreateServiceParameters(),config);
intreadyClusters=10;
intdeletingCluster=4;
intnewClusters=2;
intremoveClusters=1;
IReliableDictionary
dictionary=
awaitstateManager.GetOrAddAsync>(ClusterService.ClusterDictionaryName);
using(ITransactiontx=stateManager.CreateTransaction())
{
awaitthis.AddClusters(tx,dictionary,readyClusters,ClusterStatus.Ready);
awaitthis.AddClusters(tx,dictionary,deletingCluster,ClusterStatus.Deleting);
awaitthis.AddClusters(tx,dictionary,newClusters,ClusterStatus.New);
awaitthis.AddClusters(tx,dictionary,removeClusters,ClusterStatus.Remove);
awaittx.CommitAsync();
}
IEnumerableactual=awaittarget.GetClusterListAsync();
Assert.AreEqual(readyClusters,actual.Count());
}
原文链接:http://www.jxszl.com/biancheng/C/556782.html