예제 #1
0
        public void CanConvertFromTest()
        {
            var converter = new ObjectIdentifierConverter();

            Assert.True(converter.CanConvertFrom(typeof(string)));
            Assert.False(converter.CanConvertFrom(typeof(DateTime)));
        }
예제 #2
0
        public void ConvertToTest()
        {
            var converter = new ObjectIdentifierConverter();

            Assert.Equal("0.0", converter.ConvertTo(new ObjectIdentifier("0.0"), typeof(string)));

            Assert.Equal(string.Empty, converter.ConvertTo((ObjectIdentifier)null, typeof(string)));
        }
예제 #3
0
        public void ConvertFromTest()
        {
            var converter = new ObjectIdentifierConverter();

            Assert.Equal(new ObjectIdentifier("0.0"), converter.ConvertFrom("0.0"));

            Assert.Throws <NotSupportedException>(() => converter.ConvertFrom((string)null));
            Assert.Throws <NotSupportedException>(() => converter.ConvertFrom("notgoodstring"));
        }
예제 #4
0
        public void ToStringTest()
        {
            var converter = new ObjectIdentifierConverter();

            Assert.Equal("Object identifier converter", converter.ToString());
        }