示例#1
0
        public void op_FromString_stringEmpty()
        {
            var expected = string.Empty;
            var actual   = Telephone.FromString(expected).ToString();

            Assert.Equal(expected, actual);
        }
示例#2
0
        public void op_ToString()
        {
            const string expected = "+441111222333";
            var          actual   = Telephone.FromString(expected).ToString();

            Assert.Equal(expected, actual);
        }
示例#3
0
        public void op_FromString_string()
        {
            const string value = "+441111222333";

            var obj = Telephone.FromString(value);

            Assert.Equal(value, obj.Number);
        }
 public void prop_Number()
 {
     Assert.True(new PropertyExpectations <BritishTelephone>(p => p.Number)
                 .IsNotDecorated()
                 .TypeIs <Telephone>()
                 .ArgumentNullException()
                 .Set(Telephone.FromString("(01234) 567 890"))
                 .Result);
 }
示例#5
0
 public BritishTelephoneNumberPlanItem Item(string telephone)
 {
     return(Item(Telephone.FromString(telephone)));
 }
示例#6
0
        public void op_FromString_string_whenMissingLeadingZero()
        {
            var obj = Telephone.FromString("1111222333");

            Assert.Equal("+441111222333", obj.Number);
        }
示例#7
0
        public void op_FromString_string_whenLongInternationalFormat()
        {
            var obj = Telephone.FromString("00441111222333");

            Assert.Equal("+441111222333", obj.Number);
        }
示例#8
0
        public void op_FromString_string_whenDomesticFormatAndComment()
        {
            var obj = Telephone.FromString("(01111) 222-333 at home");

            Assert.Equal("+441111222333", obj.Number);
        }
示例#9
0
 public void op_FromString_stringNull()
 {
     Assert.Throws <ArgumentNullException>(() => Telephone.FromString(null));
 }
示例#10
0
        public void op_FromString_string_whenShortInternationalFormat()
        {
            var obj = Telephone.FromString("+1 (222) 333-4444");

            Assert.Equal("+12223334444", obj.Number);
        }
示例#11
0
        public void op_FromString_string_whenNoDigits()
        {
            var obj = Telephone.FromString("not a number");

            Assert.Null(obj.Number);
        }