I have a stored procedure that uses getdate()
for taking a current date and compare with provided.
But a problem with testing arose -> usually for testing we have prepared input and output data, and predefined dates among this data. But getdate()
will always return current time, so test results will differ in time.
I think there is no way to change what getdate()
will return? But take getdate()
out of the stored procedure and use some input parameter instead also is not an option.
What are the best practices to test such stored procedure, to make the test's result constant?