本文整理汇总了C#中Id.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Id.ToString方法的具体用法?C# Id.ToString怎么用?C# Id.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Id
的用法示例。
在下文中一共展示了Id.ToString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ComponentsOrderedAccordingToGenericParameterOrder
public void ComponentsOrderedAccordingToGenericParameterOrder()
{
#region Arrange
var expectedIdStringBuilder = new StringBuilder();
expectedIdStringBuilder.Append("fe67da762a214fa2b356d9e5da80edfc");
expectedIdStringBuilder.Append("|helloworld");
expectedIdStringBuilder.Append("|2342342343234");
expectedIdStringBuilder.Append("|0");
expectedIdStringBuilder.Append("|33");
expectedIdStringBuilder.Append("|a4bac0922c674c1b80016b680e31ba44");
var expectedIdString = expectedIdStringBuilder.ToString();
var id = new Id<Guid, String, DateTime, DayOfWeek,int,Guid>(expectedIdString);
#endregion
#region Act
var actualIdString = id.ToString();
#endregion
#region Assert
actualIdString.ShouldBeEquivalentTo(expectedIdString);
#endregion
}
示例2: ComponentsOrderedAccordingToGenericParameterOrder
public void ComponentsOrderedAccordingToGenericParameterOrder()
{
#region Arrange
var expectedIdStringBuilder = new StringBuilder();
expectedIdStringBuilder.Append("fe67da762a214fa2b356d9e5da80edfc");
var expectedIdString = expectedIdStringBuilder.ToString();
var id = new Id<Guid>(expectedIdString);
#endregion
#region Act
var actualIdString = id.ToString();
#endregion
#region Assert
actualIdString.ShouldBeEquivalentTo(expectedIdString);
#endregion
}
示例3: ParsingSGuidToSGuid
public void ParsingSGuidToSGuid()
{
var sguid = KeyFormat.ToSGuid(Guid.Parse("21952ee6-d028-433f-8634-94d6473275f0"));
var id = new Id<object>(KeyFormat.FromString("prefix-sguid"), "prefix-" + sguid);
id.ToString().ShouldBe("prefix-" + sguid);
}
示例4: ParsingGuidToGuid
public void ParsingGuidToGuid()
{
var id = new Id<object>(KeyFormat.FromString("prefix-guid"), "prefix-21952ee6-d028-433f-8634-94d6473275f0");
id.ToString().ShouldBe("prefix-21952ee6-d028-433f-8634-94d6473275f0");
}
示例5: ComponentsOrderedAccordingToGenericParameterOrder
public void ComponentsOrderedAccordingToGenericParameterOrder()
{
#region Arrange
var expectedIdStringBuilder = new StringBuilder();
expectedIdStringBuilder.Append("fe67da762a214fa2b356d9e5da80edfc");
expectedIdStringBuilder.Append("|helloworld");
expectedIdStringBuilder.Append("|23423333333");
expectedIdStringBuilder.Append("|0");
expectedIdStringBuilder.Append("|23423423423");
expectedIdStringBuilder.Append("|a4bac0922c674c1b80016b680e31ba44");
expectedIdStringBuilder.Append("|3");
expectedIdStringBuilder.Append("|helloworldagain");
expectedIdStringBuilder.Append("|333");
expectedIdStringBuilder.Append("|1");
expectedIdStringBuilder.Append("|goodbyeworld");
expectedIdStringBuilder.Append("|goodbyeworldagain");
expectedIdStringBuilder.Append("|51bfde8de5be42ebbaab0fe1628a1556");
expectedIdStringBuilder.Append("|a0fd3e021f7e48848f04f3b632f7e8c5");
var expectedIdString = expectedIdStringBuilder.ToString();
var id = new Id<Guid, String, DateTime, DayOfWeek, DateTime, Guid, DayOfWeek, String, DateTime, DateTimeKind, String, String, Guid,Guid>(expectedIdString);
#endregion
#region Act
var actualIdString = id.ToString();
#endregion
#region Assert
actualIdString.ShouldBeEquivalentTo(expectedIdString);
#endregion
}