Пример #1
0
        public void ConvertTo_InvalidTypeToNotString_Exception()
        {
            ClassA obj = new ClassA();

            var ex = Assert.Throws <TypeConversionNotSupportedException>(() => obj.ConvertTo <int>());

            ex.AssertArguments(obj.ToString(), obj.GetType().Name, typeof(int).Name);
        }
Пример #2
0
        public void ConvertTo_BaseTypeToDerivedType_Exception()
        {
            ClassA obj = new ClassA();

            var ex = Assert.Throws <TypeConversionNotSupportedException>(() => obj.ConvertTo <ClassB>());

            ex.AssertArguments(obj.ToString(), typeof(ClassA).Name, typeof(ClassB).Name);
        }