コード例 #1
0
        public void IsTrueSpecification_ReturnsFalse_ForFalse()
        {
            var isTrue = new TestSpecifications.IsTrueSpecification();

            var isSatisfiedBy = isTrue.IsSatisfiedBy(false);

            isSatisfiedBy.Should().BeFalse();
        }
コード例 #2
0
        public void NotSpeficication_ReturnsFalse_ForSatisfied()
        {
            var isTrue = new TestSpecifications.IsTrueSpecification();

            var isSatisfiedBy = isTrue.Not().IsSatisfiedBy(true);

            isSatisfiedBy.Should().BeFalse();
        }
コード例 #3
0
        public void IsTrueSpecification_ReturnsTrue_ForTrue()
        {
            var isTrue = new TestSpecifications.IsTrueSpecification();

            var isSatisfiedBy = isTrue.IsSatisfiedBy(true);

            isSatisfiedBy.Should().BeTrue();
        }
コード例 #4
0
        public void NotSpecification_ReturnsTrue_ForNotSatisfied()
        {
            var isTrue = new TestSpecifications.IsTrueSpecification();

            var isSatisfiedBy = isTrue.Not().IsSatisfiedBy(false);

            isSatisfiedBy.Should().BeTrue();
        }
コード例 #5
0
            public override Task <IExecutionResult> ExecuteCommandAsync(
                ThingyAggregate aggregate,
                TestFailedResultCommand command,
                CancellationToken cancellationToken)
            {
                var specification = new TestSpecifications.IsTrueSpecification();

                return(Task.FromResult(specification.IsNotSatisfiedByAsExecutionResult(false)));
            }
コード例 #6
0
        public void IsTrueSpecification_ReturnsFalse_ForFalse()
        {
            // Arrange
            var isTrue = new TestSpecifications.IsTrueSpecification();

            // Act
            var isSatisfiedBy = isTrue.IsSatisfiedBy(false);

            // Act
            isSatisfiedBy.Should().BeFalse();
        }
コード例 #7
0
        public void NotSpecification_ReturnsTrue_ForNotSatisfied()
        {
            // Arrange
            var isTrue = new TestSpecifications.IsTrueSpecification();

            // Act
            var isSatisfiedBy = isTrue.Not().IsSatisfiedBy(false);

            // Act
            isSatisfiedBy.Should().BeTrue();
        }
コード例 #8
0
        public void ThrowDomainErrorIfNotStatisfied_Throws_IfNotSatisfied()
        {
            // Arrange
            var isTrue = new TestSpecifications.IsTrueSpecification();

            // Act
            Assert.Throws<DomainError>(() => isTrue.ThrowDomainErrorIfNotStatisfied(false));
        }
コード例 #9
0
        public void ThrowDomainErrorIfNotStatisfied_DoesNotThrow_IfStatisfied()
        {
            // Arrange
            var isTrue = new TestSpecifications.IsTrueSpecification();

            // Act
            Assert.DoesNotThrow(() => isTrue.ThrowDomainErrorIfNotStatisfied(true));
        }