Posted By

heathbo on 07/10/14


test integration Moq

Versions (?)

Moq: Creating an integration test with database access

 / Published in: C#

using (var scope = new TransactionScope()) makes sure that any changes to the database are temporary and only last as long as the test is running.

The ExecuteScalar is used to get a value from the table.

The ExecuteNonQuery is used to insert a record that the test will use.

_target is the class that is accessing the database.

Report this snippet  

You need to login to post a comment.