Exemplo n.º 1
0
        private static void SetValuesForProperties(object o)
        {
            if (o is null)
            {
                return;
            }
            var t          = o.GetType();
            var properties = GetClass.Properties(t);

            foreach (var p in properties)
            {
                if (!p.CanWrite)
                {
                    continue;
                }
                if (p.PropertyType.Name == t.Name)
                {
                    continue;
                }
                var v = GetRandom.Value(p.PropertyType);
                p.SetValue(o, v);
            }
        }