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); }
public void Matches_returns_false_for_a_ticket_with_story_points(Ticket ticket, HasNoStoryPoints sut) { ticket.StoryPoints = 5; Assert.That(() => sut.Matches(ticket), Is.False); }
public void Matches_returns_true_for_a_ticket_without_story_points(Ticket ticket, HasNoStoryPoints sut) { ticket.StoryPoints = null; Assert.That(() => sut.Matches(ticket), Is.True); }