public void ConvertFromExpression_should_return_instance_that_has_correct_description() { // Arrange Expression <Func <int, bool> > repeatPredicate = repeat => repeat == 1; // Act var happened = Happened.ConvertFromExpression(repeatPredicate); // Assert Assert.That(happened.ToString(), Is.EqualTo("the number of times specified by the predicate 'repeat => (repeat = 1)'")); }
public bool ConvertFromExpression_should_return_instance_that_delegates_to_expression(int expected, int actual) { // Arrange Expression <Func <int, bool> > repeatPredicate = repeat => repeat == expected; // Act var happened = Happened.ConvertFromExpression(repeatPredicate); // Assert return(happened.Matches(actual)); }