本文整理匯總了C#中ClusterDescription.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# ClusterDescription.ToString方法的具體用法?C# ClusterDescription.ToString怎麽用?C# ClusterDescription.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ClusterDescription
的用法示例。
在下文中一共展示了ClusterDescription.ToString方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ToString_should_return_string_representation
public void ToString_should_return_string_representation()
{
var subject = new ClusterDescription(new ClusterId(1), ClusterConnectionMode.Standalone, ClusterType.Standalone, new[] { __serverDescription1 });
var expected = string.Format("{{ ClusterId : \"1\", ConnectionMode : \"Standalone\", Type : \"Standalone\", State : \"Disconnected\", Servers : [{0}] }}",
__serverDescription1.ToString());
subject.ToString().Should().Be(expected);
}
示例2: BuildTimeoutExceptionMessage
private string BuildTimeoutExceptionMessage(TimeSpan timeout, IServerSelector selector, ClusterDescription clusterDescription)
{
var ms = (int)Math.Round(timeout.TotalMilliseconds);
return string.Format(
"A timeout occured after {0}ms selecting a server using {1}. Client view of cluster state is {2}.",
ms.ToString(),
selector.ToString(),
clusterDescription.ToString());
}