示例#1
0
        public void Matches_returns_false_for_a_ticket_without_story_points(Ticket ticket)
        {
            var sut = new StoryPointsIsOneOf(new[] { 2, 3, 4 });

            ticket.StoryPoints = null;
            Assert.That(() => sut.Matches(ticket), Is.False);
        }
示例#2
0
        public void Matches_returns_true_for_a_ticket_with_story_points_in_the_list(Ticket ticket)
        {
            var sut = new StoryPointsIsOneOf(new[] { 2, 3, 4 });

            ticket.StoryPoints = 4;
            Assert.That(() => sut.Matches(ticket), Is.True);
        }
        ISpecificationExpression <Ticket> GetSpecFromFunction(PredicateFunction function)
        {
            ISpecificationExpression <Ticket> spec = null;

            if (function.FunctionName == PredicateName.Function.IsEmpty)
            {
                spec = new HasNoStoryPoints();
            }

            if (function.FunctionName == PredicateName.Function.IsAnyOf)
            {
                spec = new StoryPointsIsOneOf(valueResolver.ResolveAll <int>(function.Parameters));
            }

            if (spec != null && function.Inverted)
            {
                spec = spec.Not();
            }

            return(spec);
        }