public void Setup( )
        {
            _notNullTester = Substitute.For <INotNullTester> ( );

            _notNullTester.HasPassed.Returns(true);
            _notNullTester.TestValue.Returns(new object( ));
            _notNullTester.ExceptionType.Returns(typeof(Exception));
            _notNullTester.InstanceType.Returns(typeof(TestClass));
            _notNullTester.ConstructorsToTest.Returns(1);
            _notNullTester.ConstructorsFailed.Returns(2);
        }
        public void Constructor_ForNotNullTesterNull_Throws( )
        {
            _notNullTester = null;

            var action = new Action(() => CreateSut( ));

            action.Should( )
            .Throw <ArgumentNullException> ( )
            .And.ParamName.Should( )
            .Be("notNullTester");
        }
        public NotNullAssemblyTester([NotNull] IPublicClassesFinder finder,
                                     [NotNull] INotNullTester tester)
        {
            Guard.ArgumentNotNull(finder,
                                  nameof(finder));
            Guard.ArgumentNotNull(tester,
                                  nameof(tester));

            _finder = finder;
            _tester = tester;
        }
Пример #4
0
        public NotNullTesterResult([NotNull] INotNullTester notNullTester)
        {
            Guard.ArgumentNotNull(notNullTester,
                                  nameof(notNullTester));

            HasPassed     = notNullTester.HasPassed;
            TestValue     = notNullTester.TestValue;
            ExceptionType = notNullTester.ExceptionType;
            InstanceType  = notNullTester.InstanceType;
            ToTest        = notNullTester.ConstructorsToTest;
            Failed        = notNullTester.ConstructorsFailed;
        }