You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This test assumes that the order of the Tests in the TestFixture is defined.
It is not.
The order is based on the order of the Type.GetCustomAttributes return value, which is documented to be random.
Therefore, no test should be written that assumes anythings based on the order of the return value from Type.GetCustomAttributes.
This test fails on some platforms.
The lexical ordering of elements in a file is absolutely not guaranteed to be persisted in anyway in the resulting CIL assemblies nor to be respected in the results returned from Reflection. This ordering is not even guaranteed to be the same over repeated calls within the same app domain!
Note that MS have broken this ordering in other parts of reflection in the past (Noting as they did it that this actually caused some issues for some of their code), thus even if it happens to work at the moment there is nothing stopping this breaking in future or on different platforms.
The text was updated successfully, but these errors were encountered:
Of course, you are correct. This is well known to the nunit devs and is even documented for users. However, this was done by a contributor about a month ago. It's up to us to catch such things, which may be a bit esoteric to those who make contributions. I encourage everyone to review code for contributors!!!
@Suremaker Would you care to put this right? There should be two tests and one of them should have one set of args while the other has the second set. Order is indeterminate, as @oznetmaster points out, even between different versions of Microsoft runtimes and may be all the more so when using non-MS runtimes.
This test assumes that the order of the Tests in the TestFixture is defined.
It is not.
The order is based on the order of the Type.GetCustomAttributes return value, which is documented to be random.
Therefore, no test should be written that assumes anythings based on the order of the return value from Type.GetCustomAttributes.
This test fails on some platforms.
The text was updated successfully, but these errors were encountered: