Moq Transaction Scope in C#

Viewed 1382

Is there any ways to moq a transaction scope in order to ensure that commit, complete or rollback operations are called during a process?

Given this function :

public void DoSomething(int param)
{
    using (TransactionScope transactionScope = new TransactionScope())
    {
        factory.DoSomething(param);
        factory.DoSomethingElse(param);

        transactionScope.Complete();
    }
}

Is there any ways to call a Verify function over the IDisposable interface? It only seems to contain a Dispose function and I would like to test the Commit or the Rollback.

Thank you

1 Answers
Related