AutoNumber and Unit Testing

2
Hi there, I have an application in which I am using AutoNumber for InvoiceLineId's. In the unit test module, I test everything regarding invoices. An invoiceline object is created in some tests. The result is that my InvoiceLinesId's are not concurrent in my actual database anymore.  Is there some sort of solution to exclude/rollback autonumbering from my unit tests? I know that I can use calculated integer instead but this is not my preferred choise.  Thanks for the help!    
asked
2 answers
2

Hi Tim,

For unit tests, I keep a separate database on which I run them so it doesn't affect regular development/test/acceptance/production database data. 

Best regards,

Mitchel

answered
1

Hi Tim,

You can rollback your AutoNumber from your unit tests as long as you don't commit the object on database. Otherwise rolling back an AutoNumber is impossible.

Kind regards,

Arno.

answered