Exemple #1
0
        public void Should_disable_recursive_fill()
        {
            var factoryWithRecursionDisabled = new FillWithEmptyValuesTransformFactory(
                new RecursiveTransformFactoryOptions {
                EnableRecursiveInstantiation = false
            }
                );

            var transform = factoryWithRecursionDisabled.GetTransform <ClassA>();
            var instance  = new ClassA();

            transform.ApplyTo(instance);

            instance.StringProperty.Should().Be(string.Empty);
            instance.B.Should().Be(null, "should not recursively fill when it is disable via options");
        }
        internal override IEnumerable <Transform <T> > GetTransforms <T>()
        {
            var factory = new FillWithEmptyValuesTransformFactory(_recursiveTransformFactoryOptions);

            yield return(factory.GetTransform <T>());
        }