While creating DateTime object in separate method and passing it in test method by using DynamicDataAttribute, ticks in DateTime are truncated. Example:
| Ticks that used to create DateTime object |
Ticks in DateTime object in test method |
Ticks are |
| 637635456000000001 |
637635456000000000 |
TRUNCATED! |
| 637635456000000010 |
637635456000000000 |
TRUNCATED! |
| 637635456000000100 |
637635456000000000 |
TRUNCATED! |
| 637635456000001000 |
637635456000000000 |
TRUNCATED! |
| 637635456000010000 |
637635456000010000 |
correct |
| 637635456000100000 |
637635456000100000 |
correct |
| 637635456001000000 |
637635456001000000 |
correct |
| 637635456010000000 |
637635456010000000 |
correct |
| 637635456100000000 |
637635456100000000 |
correct |
Here is the project that demonstrates the issue:
https://github.com/anatol83/MSTest.TestAdapter.ErrorWithDateTime_Example.git