public void Execute_Should_ReturnCorrectNumberOfMessages(OrderDirective order, OperationDirective operation) { var handler = new OperationHandlerContainer <PersonStub>(OperationHandlers); var expectedFirstName = EnumUtilities.GetDescription(order); var expectedLastName = expectedFirstName + EnumUtilities.GetDescription(operation); var container = handler.GetHandlerContainer(order, operation); var person = PersonFactory.CreateEmpty(); var messages = new List <string>(); container.InvalidResult += (object sender, ValidationHandlerArgs e) => messages.Add(e.ValidationResult.ErrorMessage); container.Execute(person); person.FirstName.Should().Be(expectedFirstName); person.LastName.Should().Be(expectedLastName); messages.Count.Should().Be(2); messages.Should().Contain(expectedFirstName); messages.Should().Contain(expectedLastName); }