当前位置: 首页>>代码示例>>C#>>正文


C# Id.ToString方法代码示例

本文整理汇总了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
            }
开发者ID:TonightWe,项目名称:TW.UbiquitousId,代码行数:29,代码来源:SixComponentIdTests.cs

示例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
            }
开发者ID:TonightWe,项目名称:TW.UbiquitousId,代码行数:24,代码来源:OneComponentIdTests.cs

示例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);
        }
开发者ID:RichieYang,项目名称:Cirqus,代码行数:7,代码来源:IdTests.cs

示例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");
 }
开发者ID:RichieYang,项目名称:Cirqus,代码行数:5,代码来源:IdTests.cs

示例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
            }
开发者ID:TonightWe,项目名称:TW.UbiquitousId,代码行数:37,代码来源:FourteenComponentIdTests.cs


注:本文中的Id.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。