Exemplo n.º 1
0
        public void CanConvertToStringWithFormat(SimpleValue value, string format, string expectedValue)
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("ru-RU");
            var actualValue = value.ToString(format);

            Assert.AreEqual(expectedValue, actualValue);
        }
Exemplo n.º 2
0
        public void CanConvertToString(SimpleValue value, string expectedValue)
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-US");

            var actualValue = value.ToString();

            Assert.AreEqual(expectedValue, actualValue);
        }
Exemplo n.º 3
0
 public void ToStringThrows()
 {
     Assert.Throws <ArgumentOutOfRangeException>(() => InvalidValue.ToString());
 }
Exemplo n.º 4
0
        public void CanConvertToStringWithCulture(SimpleValue value, string expectedValue)
        {
            var actualValue = value.ToString(CultureInfo.GetCultureInfo("ru-RU"));

            Assert.AreEqual(expectedValue, actualValue);
        }
Exemplo n.º 5
0
        public override string ToString()
        {
            StringBuilder __sb    = new StringBuilder("Complex(");
            bool          __first = true;

            if (SimpleValue != null && __isset.simpleValue)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("SimpleValue: ");
                __sb.Append(SimpleValue == null ? "<null>" : SimpleValue.ToString());
            }
            if (ListValue != null && __isset.listValue)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("ListValue: ");
                __sb.Append(ListValue);
            }
            if (SetValue != null && __isset.setValue)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("SetValue: ");
                __sb.Append(SetValue);
            }
            if (MapValue != null && __isset.mapValue)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("MapValue: ");
                __sb.Append(MapValue);
            }
            if (ListSetMap != null && __isset.listSetMap)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("ListSetMap: ");
                __sb.Append(ListSetMap);
            }
            if (MapList != null && __isset.mapList)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("MapList: ");
                __sb.Append(MapList);
            }
            if (ListOfList != null && __isset.listOfList)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("ListOfList: ");
                __sb.Append(ListOfList);
            }
            if (ListOfListOfList != null && __isset.listOfListOfList)
            {
                if (!__first)
                {
                    __sb.Append(", ");
                }
                __first = false;
                __sb.Append("ListOfListOfList: ");
                __sb.Append(ListOfListOfList);
            }
            __sb.Append(")");
            return(__sb.ToString());
        }