I am writing integration tests and I use TransactionScope(TransactionScopeAsyncFlowOption.Enabled) for this purpose. I add some data to DB (MS SQL Server) and then check the result, compare it etc. When the test is passed, new data will not be saved in DB. So this approach worked always fine. When I debug test I can check new records in DB, e. g.
SELECT * FROM Users
WITH(NOLOCK)
Where UserId = 2
But now I need to check the CONTAINS predicate when I debug my test, e. g.
SELECT * FROM Users
WITH(NOLOCK)
WHERE CONTAINS(Surname, 'White')
And this query returns only present records in my DB, but it doesn't return the uncommitted record, which I add in my test. The field "Surname" of course accepts full-text search. I have read information about predicate CONTAINS, but I didn't find the answer. Can predicate Contains work with uncommitted records ? If yes, how can it be done ?