Nuint's use of the use of NUINT [original]

xiaoxiao2021-03-06  36

NUINT Test the TestCase of the database operation, a problem is how to recover database data after the test, and one way to see online is to use the transaction rollback.

Mainly using the following code

Using system;

Using nunit.framework;

Using system.enterprises;

Namespace TransactionTesting

{

[TestFixTure]

[Transaction (TransactionOption.Required)]

Public Class DatabaseFixTure: ServicesDComponent

{

[Teardown]

Public void Transactionteardown ()

{

ContextUtil.isintransaction

{

Contextutil.Setabort ();

}

}

}

}

转载请注明原文地址:https://www.9cbs.com/read-54321.html

New Post(0)