AK.F1.Timing.Serialization.PropertyDescriptorTest.get_and_set_value_wraps_expected_exceptions C# (CSharp) 메소드

get_and_set_value_wraps_expected_exceptions() 개인적인 메소드

private get_and_set_value_wraps_expected_exceptions ( Type exceptionType ) : void
exceptionType Type
리턴 void
        public void get_and_set_value_wraps_expected_exceptions(Type exceptionType)
        {
            var property = PropertyDescriptor.For(typeof(TypeWithThrowingProperty).GetProperty("Property"));
            var component = new TypeWithThrowingProperty((Exception)FormatterServices.GetUninitializedObject(exceptionType));

            Assert.Throws<SerializationException>(() => property.SetValue(component, null));
            Assert.Throws<SerializationException>(() => property.GetValue(component));
        }