public void Initialize( ) { _exceptionFinder = Substitute.For <IArgumentNullExceptionFinder> ( ); _attributeFinder = Substitute.For <ICustomAttributeFinder> ( ); _generator = Substitute.For <IArgumentsGenerator> ( ); _typeClass = typeof(Something); _typeInt = typeof(int); _instance = new Something(new SomethingElse( )); }
public void Constructor_ForAttributeFinderIsNull_Throws( ) { _attributeFinder = null; Action action = () => { CreateSut( ); }; action.Should( ) .Throw <ArgumentNullException> ( ) .WithParameter("attributeFinder"); }
public SutLazyInstanceCreator([NotNull] IArgumentNullExceptionFinder exceptionFinder, [NotNull] ICustomAttributeFinder attributeFinder) { Guard.ArgumentNotNull(exceptionFinder, nameof(exceptionFinder)); Guard.ArgumentNotNull(attributeFinder, nameof(attributeFinder)); _exceptionFinder = exceptionFinder; _attributeFinder = attributeFinder; }