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


C# PhoneNumber.ToString方法代码示例

本文整理汇总了C#中PhoneNumber.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# PhoneNumber.ToString方法的具体用法?C# PhoneNumber.ToString怎么用?C# PhoneNumber.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhoneNumber的用法示例。


在下文中一共展示了PhoneNumber.ToString方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: NumericPhoneNumber

        public void NumericPhoneNumber()
        {
            const string phoneNumber = "0100100";

            sut = PhoneNumber.Create(phoneNumber);

            Assert.AreEqual(phoneNumber, sut.ToString());
        }
开发者ID:affecto,项目名称:dotnet-Identifiers.Finnish,代码行数:8,代码来源:PhoneNumberTests.cs

示例2: NumericPhoneNumberWithWhiteSpaces

        public void NumericPhoneNumberWithWhiteSpaces()
        {
            const string phoneNumber = "02 588 4430";

            sut = PhoneNumber.Create(phoneNumber);

            Assert.AreEqual(phoneNumber, sut.ToString());
        }
开发者ID:affecto,项目名称:dotnet-Identifiers.Finnish,代码行数:8,代码来源:PhoneNumberTests.cs

示例3: btAddPhoneNumber_Click

 private void btAddPhoneNumber_Click(object sender, EventArgs e)
 {
     if (tbEditNumber.Text == "")
     {
         return;
     }
     PhoneNumber newNumber = new PhoneNumber(tbEditNumber.Text, lbLabels.SelectedItem.ToString());
     lbNumbers.Items.Add(newNumber.ToString());
     tbEditNumber.Text = "";
 }
开发者ID:alena-butkevich,项目名称:OOP,代码行数:10,代码来源:FormForEdit.cs

示例4: btEditNumber_Click

 private void btEditNumber_Click(object sender, EventArgs e)
 {
     if (tbEditNumber.Text == "" || lbNumbers.SelectedItems.Count == 0)
     {
         return;
     }
     String phonenumber = lbNumbers.SelectedItem.ToString();
     if (lbLabels.SelectedItems.Count == 0)
     {
         return;
     }
     lbNumbers.Items.RemoveAt(lbNumbers.SelectedIndex);
     PhoneNumber newNumber = new PhoneNumber(tbEditNumber.Text, lbLabels.SelectedItem.ToString());
     lbNumbers.Items.Add(newNumber.ToString());
     tbEditNumber.Text = "";
 }
开发者ID:alena-butkevich,项目名称:OOP,代码行数:16,代码来源:FormForEdit.cs

示例5: Print

        public void Print()
        {
            var number = new PhoneNumber("1-878-443-2908 ext. 23");
            Assert.AreEqual("1-878-443-2908x23", number.ToString());

            number = new PhoneNumber("6048537994");
            Assert.AreEqual("6048537994", number.ToString());

            number = new PhoneNumber("-604-5527455x");
            Assert.AreEqual("604-5527455", number.ToString());
            // test for manually set values
            number = new PhoneNumber {
                Country = null,
                Area = null,
                Local = "12346",
                Extension = null
            };

            Assert.AreEqual("12346", number.ToString());
        }
开发者ID:jeremiahredekop,项目名称:Nvelope,代码行数:20,代码来源:PhoneNumberTests.cs

示例6: ToStringReturnsValue

        public void ToStringReturnsValue()
        {
            var phoneNumber = new PhoneNumber("01234 567890");

            Assert.Equal("01234 567890", phoneNumber.ToString());
        }
开发者ID:EnvironmentAgency,项目名称:prsd-iws,代码行数:6,代码来源:PhoneNumberTests.cs

示例7: TestToString

 public void TestToString()
 {
     var phone = new PhoneNumber("2055551212");
     Assert.AreEqual("2055551212", phone.ToString());
 }
开发者ID:rickeygalloway,项目名称:Test,代码行数:5,代码来源:TestPhoneNumber.cs

示例8: Formats_a_number

 public void Formats_a_number()
 {
     var phone = new PhoneNumber("1234567890");
     Assert.That(phone.ToString(), Is.EqualTo("(123) 456-7890"));
 }
开发者ID:cameronjkelley,项目名称:exercism,代码行数:5,代码来源:PhoneNumberTest.cs

示例9: LandLineNumberWithCountryPrefix

        public void LandLineNumberWithCountryPrefix()
        {
            const string phoneNumber = "+358 9 451 4319";

            sut = PhoneNumber.Create(phoneNumber);

            Assert.AreEqual(phoneNumber, sut.ToString());
        }
开发者ID:affecto,项目名称:dotnet-Identifiers.Finnish,代码行数:8,代码来源:PhoneNumberTests.cs

示例10: CellPhoneNumberWithCountryPrefix

        public void CellPhoneNumberWithCountryPrefix()
        {
            const string phoneNumber = "+35850 123 4567";

            sut = PhoneNumber.Create(phoneNumber);

            Assert.AreEqual(phoneNumber, sut.ToString());
        }
开发者ID:affecto,项目名称:dotnet-Identifiers.Finnish,代码行数:8,代码来源:PhoneNumberTests.cs

示例11: CellPhoneNumberWithLine

        public void CellPhoneNumberWithLine()
        {
            const string phoneNumber = "050-1234567";

            sut = PhoneNumber.Create(phoneNumber);

            Assert.AreEqual(phoneNumber, sut.ToString());
        }
开发者ID:affecto,项目名称:dotnet-Identifiers.Finnish,代码行数:8,代码来源:PhoneNumberTests.cs

示例12: PhoneNumberWithManyNumbersBeforeTheFirstWhiteSpace

        public void PhoneNumberWithManyNumbersBeforeTheFirstWhiteSpace()
        {
            const string phoneNumber = "0295 50 3000";

            sut = PhoneNumber.Create(phoneNumber);

            Assert.AreEqual(phoneNumber, sut.ToString());
        }
开发者ID:affecto,项目名称:dotnet-Identifiers.Finnish,代码行数:8,代码来源:PhoneNumberTests.cs

示例13: PhoneNumber_Unit_ToString_Optimal

        public void PhoneNumber_Unit_ToString_Optimal()
        {
            String countryCode = "1";
            String areaCode = "800";
            String[] subscriberNumberGroups = new String[] { "abc", "defg" };
            PhoneNumber target = new PhoneNumber(countryCode, areaCode, subscriberNumberGroups);

            String expected = new String[] { countryCode, areaCode }.Concat(subscriberNumberGroups).ToArray().Join(' ');
            String actual = target.ToString();
            Assert.AreEqual(expected, actual);
        }
开发者ID:cegreer,项目名称:Common,代码行数:11,代码来源:PhoneNumberTests.cs


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