System.Runtime.Serialization.Formatters.Tests.FormatterConverterTests.ToMethods_ExpectedValue C# (CSharp) Метод

ToMethods_ExpectedValue() приватный Метод

private ToMethods_ExpectedValue ( ) : void
Результат void
        public void ToMethods_ExpectedValue()
        {
            Assert.True(new FormatterConverter().ToBoolean("true"));
            Assert.Equal((byte)42, new FormatterConverter().ToByte("42"));
            Assert.Equal('c', new FormatterConverter().ToChar("c"));
            Assert.Equal(new DateTime(2000, 1, 1), new FormatterConverter().ToDateTime(new DateTime(2000, 1, 1).ToString(CultureInfo.InvariantCulture)));
            Assert.Equal(1.2m, new FormatterConverter().ToDecimal("1.2"));
            Assert.Equal(1.2, new FormatterConverter().ToDouble("1.2"));
            Assert.Equal((short)42, new FormatterConverter().ToInt16("42"));
            Assert.Equal(42, new FormatterConverter().ToInt32("42"));
            Assert.Equal(42, new FormatterConverter().ToInt64("42"));
            Assert.Equal((sbyte)42, new FormatterConverter().ToSByte("42"));
            Assert.Equal(1.2f, new FormatterConverter().ToSingle("1.2"));
            Assert.Equal("1.2", new FormatterConverter().ToString("1.2"));
            Assert.Equal((ushort)42, new FormatterConverter().ToUInt16("42"));
            Assert.Equal((uint)42, new FormatterConverter().ToUInt32("42"));
            Assert.Equal((ulong)42, new FormatterConverter().ToUInt64("42"));
            Assert.Equal(42, new FormatterConverter().Convert("42", TypeCode.Int32));
        }