Skip to content
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

Add new assertions tSQLt.AssertIsNull, tSQLt.AssertNotNull #9

Open
bartread opened this issue Oct 5, 2016 · 1 comment
Open

Add new assertions tSQLt.AssertIsNull, tSQLt.AssertNotNull #9

bartread opened this issue Oct 5, 2016 · 1 comment

Comments

@bartread
Copy link

bartread commented Oct 5, 2016

These would be used for testing whether or not, for example, some variable has a value. E.g.:

EXEC @insertedAddressId = [someschema].[SomeStoredProcedure] ...
EXEC tSQLt.AssertNotNull
    @Value = @insertedAddressId
    @Messsage = N'Should have returned a non-null ID for INSERTed address.'

tSQLt.AssertIsNull would have similar syntax and usage.

@mbt1
Copy link
Collaborator

mbt1 commented Oct 15, 2016

This is on the backlog already. For now, you can use tSQLt.AssertEquals and tSQLt.AssertNotEquals to achieve the same thing.

However, I question the usefulness of your example test. Instead of asserting that any value is returned, you should assert that the correct value is returned. You could for example do this: Fake the table and then insert a row. You will end up with a single row in that table. Its ID should match the returned value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants