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( ))); }
public void Constructor_ForLazyCreatorIsNull_Throws( ) { _lazyCreator = null; Action action = () => { CreateSut( ); }; action.Should( ) .Throw <ArgumentNullException> ( ) .WithParameter("lazyCreator"); }
public SutCreator([NotNull] ISutInstanceCreator creator, [NotNull] ISutLazyInstanceCreator lazyCreator) { Guard.ArgumentNotNull(creator, nameof(creator)); Guard.ArgumentNotNull(lazyCreator, nameof(lazyCreator)); _creator = creator; _lazyCreator = lazyCreator; }