public string[] Assert_that_query_history_updated_appropriately(string[][] queryNames) { var sqlServerToMonitor = new SqlServer("Best_DB_Ever", "", false); Assert.That(sqlServerToMonitor.QueryHistory.Count, Is.EqualTo(0), "History Should start off empty"); queryNames.ForEach(queryNamesPass => { var queryContexts = queryNamesPass.Select(queryName => { var queryContext = Substitute.For<IQueryContext>(); queryContext.QueryName.Returns(queryName); return queryContext; }).ToArray(); sqlServerToMonitor.UpdateHistory(queryContexts); }); var actual = sqlServerToMonitor.QueryHistory.Select(qh => string.Format("{0}:{1}", qh.Key, qh.Value.Count)).ToArray(); return actual; }