-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DateTime equality test fails after upgrading from 2.2.3 #1121
Comments
Value returned from |
I am investigating the issue, meanwhile as a workaround, you can add this to your assembly. [assembly: TestDataSourceDiscovery(TestDataSourceDiscoveryOption.DuringExecution)] |
Hey @sharkk121, sorry for the huge delay, your issue is next on my list. I am starting the investigation at the moment and expect to post some results early next week. |
Alright so I did some progress in the investigation. MSTest is using I need to debug further to understand how I can move forward with doing a better serialization. |
Hi @sharkk121, so the fix is going to be quite big as it requires changing the serializer used. I will postpone the fix for v4. In the meantime, you can use the trick described by @Haplois:
|
Closing this issue as it will be handled as part of the more global ticket #1462 |
Description
Hello, after updating the version of MSTest.TestAdapter and MSTest.TestFramework from 2.2.3 to 2.2.10 I found that the test that used to pass, started failing. On version 2.2.3 the date, when passed into the method is an actual DateTime object. On 2.2.10, the date is serialized as string instead. What's strange is that a very similar test, but with an extra complex type included passes as expected.
While searching for potential breaking changes I only found the following in the release notes of version 2.2.5, but I'm not sure if it's related:
Steps to reproduce
Simply create a new empty Unit Test project that targets .NET 6 and paste the following in the test file. Compare the results with packages MSTest.TestAdapter and MSTest.TestFramework installed at version 2.2.3 and 2.2.10.
Expected behavior
Both tests pass.
Actual behavior
Test 1 fails with an error.
Test 2 passes.
Assert.AreEqual failed. Expected:<02.06.2022 00:00:00 (System.DateTime)>. Actual:<2022-06-02T00:00:00.0000000 (System.String)>.
Environment
AB#1642311
The text was updated successfully, but these errors were encountered: