Skip to content

Commit

Permalink
Fixed a bug in the EventParametersMustBeInOrder rule
Browse files Browse the repository at this point in the history
  • Loading branch information
rstaib authored Nov 6, 2017
1 parent 34eb99c commit 7118d3b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Analyzer/Rules/EventParametersMustBeInOrder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ public IResult Apply(EventSchema schema, EventSource eventSource)
string exceptionMessage = null;
bool eventExecuted = (method != null &&
eventSource.TryInvokeMethod(schema, method, values, out exceptionMessage) &&
listener.OrderedEvents.Count() == 1);
listener.OrderedEvents.Count(e => e.EventId > 0) == 1);

if (eventExecuted)
{
string errorMessage = CheckPayloadOrder(schema, method, parameters,
listener.OrderedEvents.First());
listener.OrderedEvents.First(e => e.EventId > 0));

if (errorMessage != null)
{
Expand All @@ -76,7 +76,7 @@ public IResult Apply(EventSchema schema, EventSource eventSource)
else
{
return new Error(this, "This rule could not be executed successfully, " +
"because the preconditions failed.");
"because the preconditions failed.", new[] { exceptionMessage });
}
}
finally
Expand Down

0 comments on commit 7118d3b

Please sign in to comment.