Skip to content

Commit

Permalink
adding more test logging
Browse files Browse the repository at this point in the history
  • Loading branch information
brettsam committed Mar 3, 2018
1 parent 8f237c6 commit 2f0e9a1
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ public async Task AggregatorOnly()
JobHost host = new JobHost(_hostConfig);

await host.StartAsync();
await host.CallAsync(typeof(AsyncChainEndToEndTests).GetMethod("WriteStartDataMessageToQueue"));
await host.CallAsync(typeof(AsyncChainEndToEndTests).GetMethod(nameof(WriteStartDataMessageToQueue)));

_functionCompletedEvent.WaitOne();

Expand All @@ -295,7 +295,13 @@ public async Task AggregatorOnly()

// Make sure the aggregator was logged to
var logger = _loggerProvider.CreatedLoggers.Where(l => l.Category == LogCategories.Aggregator).Single();
Assert.Equal(4, logger.LogMessages.Count);
var count = logger.LogMessages.Count;

// Pull the name of the function out for a more descriptive failure message.
var names = logger.LogMessages.Select(p => p.State.Single(s => s.Key == "Name").Value.ToString());
var failureMessage = string.Join(Environment.NewLine, names);

Assert.True(count == 4, $"Expected 4. Actual {count}. {failureMessage}");
}
}

Expand Down

0 comments on commit 2f0e9a1

Please sign in to comment.