コード例 #1
0
 public void Initialize( )
 {
     _creator       = Substitute.For <ISutInstanceCreator> ( );
     _lazyCreator   = Substitute.For <ISutLazyInstanceCreator> ( );
     _generator     = Substitute.For <IArgumentsGenerator> ( );
     _typeClass     = typeof(Something);
     _typeLazyClass = typeof(Lazy <Something>);
     _class         = new Something(new SomethingElse( ));
     _lazyClass     = new Lazy <Something> (() => new Something(new SomethingElse( )));
 }
コード例 #2
0
        public void Constructor_ForLazyCreatorIsNull_Throws( )
        {
            _lazyCreator = null;

            Action action = () => { CreateSut( ); };

            action.Should( )
            .Throw <ArgumentNullException> ( )
            .WithParameter("lazyCreator");
        }
コード例 #3
0
        public SutCreator([NotNull] ISutInstanceCreator creator,
                          [NotNull] ISutLazyInstanceCreator lazyCreator)
        {
            Guard.ArgumentNotNull(creator,
                                  nameof(creator));
            Guard.ArgumentNotNull(lazyCreator,
                                  nameof(lazyCreator));

            _creator     = creator;
            _lazyCreator = lazyCreator;
        }