public void TrueSpecification_ReturnFalse(bool isNegatable)
            {
                var specification = isNegatable ? MockNegatableSpecification.True() : MockSpecification.True();
                var sut           = new SpecificationAdapter <object>(specification);

                var result = sut.IsNotSatisfiedBy(new object());

                Assert.False(result);
            }
            public void NullCandidate_NoException(bool isNegatable)
            {
                var specification = isNegatable ? MockNegatableSpecification.True() : MockSpecification.True();
                var sut           = new SpecificationAdapter <object>(specification);

                var exception = Record.Exception(() => sut.IsNotSatisfiedBy(null));

                Assert.Null(exception);
            }
            public void CorrectNegatableSpecification_ReturnIsNotSatisfiedByExecutionInExpression()
            {
                var specification = MockNegatableSpecification.True();
                var sut           = new SpecificationAdapter <object>(specification);

                var expression = sut.GetNegationExpression();
                var result     = expression.ToString();

                Assert.Matches(@"candidate => .*.IsNotSatisfiedBy\(candidate\)", result);
            }
            public void RelatedNegatableTypes_NoException()
            {
                var specification = MockNegatableSpecification <IEnumerable <char> > .True();

                var exception = Record.Exception(() =>
                {
                    var sut = new SpecificationAdapter <ChildFakeType>(specification);
                    sut.IsNotSatisfiedBy(new ChildFakeType());
                });

                Assert.Null(exception);
            }