Beispiel #1
0
        public void Construct_ForTypeClass_Instance( )
        {
            _creator.Construct(_generator,
                               _typeClass)
            .Returns(_class);

            CreateSut( ).Construct(_generator,
                                   _typeClass)
            .Should( )
            .Be(_class);
        }
        public object Construct(IArgumentsGenerator generator,
                                Type type)
        {
            Guard.ArgumentNotNull(generator,
                                  nameof(generator));
            Guard.ArgumentNotNull(type,
                                  nameof(type));

            if (IsLazy(type))
            {
                return(_lazyCreator.Construct(generator,
                                              type.GenericTypeArguments
                                              .First( )));
            }

            return(_creator.Construct(generator,
                                      type));
        }