That's because of the way 'yield return' and IEnumerable<> works.
So when you call Test() it doesn't actually running the loop, it just returns an IEnumerable<>.
To prove you can run this code -
var stopwatch = Stopwatch.StartNew();
var results = Test();
Console.WriteLine("Time after running Test {0}", stopwatch.ElapsedMilliseconds);
foreach (var result in results)
{
Console.WriteLine("Looping {0}", stopwatch.ElapsedMilliseconds);
}
So only after this line of code- t.Result.Sum (r => r).Dump(); You start looping and waiting on the Task.Delay(500).Wait(); When finished will sum up the numbers and write it to the console.