Ejemplo n.º 1
0
        public void ItErrorsWhenNestedPropertyTypeIsUnresolvable()
        {
            var gen = new ReflectedGen <ClassWithOneNestedProperty>(ImmutableDictionary.Create <Type, IGen>());

            Action action = () => gen.SampleOne(seed: 0);

            action.Should()
            .Throw <Exceptions.GenErrorException>()
            .WithMessage("Error while running generator ReflectedGen: could not resolve type 'System.Int32' at path '$.Property.Property'");
        }
Ejemplo n.º 2
0
        public void ItErrorsWhenPrimitiveIsUnresolvable()
        {
            var gen = new ReflectedGen <int>(ImmutableDictionary.Create <Type, IGen>());

            Action action = () => gen.SampleOne(seed: 0);

            action.Should()
            .Throw <Exceptions.GenErrorException>()
            .WithMessage("Error while running generator ReflectedGen: could not resolve type 'System.Int32'");
        }