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
Consider this one-liner: Assert.AreEqual<dynamic>((dynamic)null, (dynamic)null);
In MSTest 3.2.1 it passed as true
in MSTest 3.2.2+ it fails with:
Assert.AreEqual failed. Expected:<(null)>. Actual:<(null)>.
at CallSite.Target(Closure , CallSite , Type , Object , Object )
at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid3[T0,T1,T2](CallSite site, T0 arg0, T1 arg1, T2 arg2)
Expected behavior
I'm no expert on the CLR dynamic specifics, but comparing two instances of (dynamic)null should probably pass, so the behavior in MSTest 3.2.2+ is the wrong one?
Tested in a .NET 4.8 Test project in VS 17.10.3
The text was updated successfully, but these errors were encountered:
Thanks for the bug report. I confirm that I can reproduce the error and that at runtime, it seems to be picking the newly added overload with IEquatable<T> as you are pointing out. I will post back some update when I find what we can do.
One of our tests started failing after updating MSTest, we use two paths to retrieve some db resources and we are comparing that both retrieve null. I was able to fix it already by using strong type instead of dynamic.
We still have an invalid case for the IEquatable overloads when both are null, it should be considered as passing. Fixing this case is also fixing the one mentioned here.
Consider this one-liner:
Assert.AreEqual<dynamic>((dynamic)null, (dynamic)null);
In MSTest 3.2.1 it passed as true
in MSTest 3.2.2+ it fails with:
Expected behavior
I'm no expert on the CLR
dynamic
specifics, but comparing two instances of(dynamic)null
should probably pass, so the behavior in MSTest 3.2.2+ is the wrong one?Tested in a .NET 4.8 Test project in VS 17.10.3
The text was updated successfully, but these errors were encountered: