コード例 #1
0
        public void Matches_returns_true_for_a_ticket_which_has_no_labels(Ticket ticket)
        {
            // Arrange
            ticket.Labels.Clear();
            var sut = new HasNoLabels();

            // Act
            var result = sut.Matches(ticket);

            // Assert
            Assert.That(result, Is.True);
        }
コード例 #2
0
        public void Matches_returns_true_for_a_ticket_which_has_one_label(Ticket ticket, Label label)
        {
            // Arrange
            ticket.Labels.Clear();
            ticket.Labels.Add(label);
            var sut = new HasNoLabels();

            // Act
            var result = sut.Matches(ticket);

            // Assert
            Assert.That(result, Is.False);
        }
コード例 #3
0
        public ISpecificationExpression <Ticket> ConvertToSpecification(Criterion criterion)
        {
            var predicateFunction = criterion?.Test as PredicateFunction;

            if (predicateFunction == null)
            {
                return(null);
            }
            var spec = new HasNoLabels();

            if (predicateFunction.Inverted)
            {
                return(spec.Not());
            }

            return(spec);
        }