AK.F1.Timing.Serialization.PropertyDescriptorTest.get_and_set_value_wraps_expected_exceptions C# (CSharp) Method

get_and_set_value_wraps_expected_exceptions() private method

private get_and_set_value_wraps_expected_exceptions ( Type exceptionType ) : void
exceptionType Type
return 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));
        }