public void TestForEach() { // Arrange var actor = new FieldForEachParallel(); var fields = typeof(FieldForEachEntity).GetFields(BindingFlags.NonPublic | BindingFlags.Instance).OrderBy(fi => fi.Name); var entity = new FieldForEachEntity(); var actual = new System.Collections.Concurrent.ConcurrentBag<string>(); const int EXPECTED = 10; // Act actor.ForEach(entity, new QuillInjectionContext(), fields, (e, field, context) => actual.Add(field.Name)); // Assert Assert.AreEqual(EXPECTED, actual.Count()); }