Exemplo n.º 1
0
        public void TestRandomGenerationForType(Type type)
        {
            var constants = new Dictionary <Type, ISet <object> >
            {
                [typeof(int)] = new HashSet <object>()
                {
                    1, 2, 3, 4, 5, 6
                },
            };

            var generator = new RandomValueGenerator(constants);
            var result    = ReflectionUtilities.ApplyTypeVisitor(generator, type);

            Assert.IsTrue(type.IsAssignableFrom(result.GetType()));
        }