ArchiMetrics.Analysis.Tests.DtoReadTests.CanReadProperty C# (CSharp) Method

CanReadProperty() private method

private CanReadProperty ( Type type ) : void
type System.Type
return void
        public void CanReadProperty(Type type)
        {
            var constructorArgs = GetConstructorArgs(type);
            var instance = Activator.CreateInstance(type, constructorArgs);
            var properties = type.GetProperties();

            foreach (var property in properties)
            {
                try
                {
                    var x = property.GetValue(instance);
                }
                catch
                {
                    Assert.True(false, "Could not read property: " + property.Name + " of type: " + type.Name);
                }
            }
        }