vrakeshreddy / mb-unit

Automatically exported from code.google.com/p/mb-unit
0 stars 0 forks source link

StaticTestFactory invoked twice during exploration #617

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Make a class with the following in it:

[StaticTestFactory]
private static IEnumerable<Test> Steve()
{
    DiagnosticLog.WriteLine("Hey! It's Steve...");
    yield return new TestSuite("Foo");
}

2. Build and load the assembly in Icarus

What is the expected output? What do you see instead?
Notice in the Runtime log that message "Hey! It's Steve..." is written
twice. I would only expect the method to be invoked only once during
exploration.

What version of the product are you using? On what operating system?
3.1 Update 2 build 397 - x64. Win 7 x64.

Original issue reported on code.google.com by kent.han...@gmail.com on 29 Jan 2010 at 9:41

GoogleCodeExporter commented 9 years ago

Original comment by grahamr...@gmail.com on 21 Feb 2010 at 7:10

GoogleCodeExporter commented 9 years ago
The items are enumerated a first time to verify that none is null, and a second 
time for the real construction of the tests. I guess that it may be potentially 
problematic to enumerate twice items that are possibly expensive to build. 

The two enumeration processes are easy to merge anyway...

Original comment by Yann.Tre...@gmail.com on 14 Aug 2010 at 8:17

GoogleCodeExporter commented 9 years ago
Fixed.
Thank you Kent, for having reported this issue.

Regards,
Yann

Original comment by Yann.Tre...@gmail.com on 14 Aug 2010 at 8:23