There is an unsaved comment in progress. You will lose your changes if you continue. Are you sure you want to reopen the work item?
Add Dynamic Values to Asserts
Add support for dynamic values in Asserts
paulkrug17 wrote Feb 25 at 11:56 AM
One example would be setting a user variable to the current date. If the expected value could be something like "getdate()" or "Now().Date()". I can always put today's date in as a literal (e.g., "2/25/2009 00:00:00", but when
I run the whole test suite tomorrow, that will now fail. Another example is a task that determines the age of log files (for purging files over, say, 30 days old). If I have a task that determines that age, that will be variable over time. A third example
might be to independently determine the number of rows that should be determined by a SQL query. That case is less valuable because all that's being tested is that SQL gets called with the right query and returns the result. Plus, I can get around this case
with test setup in some cases.