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); }
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); }
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); }