public void PositiveIntegerAttributeSpecification_IsNotSatisfiedByNonMatchingCandidate()
        {
            var matchingCandidate = new TestCandidate {
                IntegerAtttribute = -3
            };

            Assert.That(positiveIntegerAttribute.IsSatisfiedBy(matchingCandidate), Is.False);
        }
        public void PositiveIntegerAttributeSpecification_AndNonEmptyStringAttributeSpecification_IsSatisfiedByMatchingCandidate()
        {
            var andedSpecification = positiveIntegerAttribute
                                     .And(nonEmptyStringAttribute);

            var candidate = new TestCandidate {
                IntegerAtttribute = 1, StringAttribute = "test"
            };

            Assert.That(andedSpecification.IsSatisfiedBy(candidate), Is.True);
        }
        public void PositiveIntegerAttributeSpecification_AndNonEmptyStringAttributeSpecification_IsNotSatisfiedByNonMatchingCandidate()
        {
            var andedSpecification = positiveIntegerAttribute
                                     .And(nonEmptyStringAttribute);

            var candidate = new TestCandidate {
                IntegerAtttribute = 1, StringAttribute = string.Empty
            };

            Assert.IsFalse(andedSpecification.IsSatisfiedBy(candidate));
        }
        public void PositiveIntegerAttributeSpecification_OrNonEmptyStringAttributeSpecification_IsSatisfiedByMatchingCandidate()
        {
            var oredSpecification = positiveIntegerAttribute
                                    .Or(nonEmptyStringAttribute);

            var candidate = new TestCandidate {
                IntegerAtttribute = 1, StringAttribute = string.Empty
            };

            Assert.IsTrue(oredSpecification.IsSatisfiedBy(candidate));
        }
        public void NegatesSpecifiedSpecification()
        {
            // Arrange
            candidate = new TestCandidate {
                StringAttribute = "NonEmpty", IntegerAtttribute = 5
            };
            originalSpecification = new NonEmptyStringAttributeSpecification();

            specificationUnderTest = new NotSpecification <TestCandidate>(originalSpecification);

            // Act & Assert
            Assert.That(specificationUnderTest.IsSatisfiedBy(candidate), Is.False.And.Not.EqualTo(originalSpecification.IsSatisfiedBy(candidate)));
        }