Returns currently running unit test identification number. Unit test identification number assigned by the DB Test Driven framework for each unit test run, every time you will run unit test a new run id will be generated.

Note: When manually running a unit test make sure that unit test source code calls DBTD_UNIT_TEST hint procedure that specifies a unit test suite.

Arguments

  • v_UnitTestRunID - The current unit test identification number, INT, OUTPUT parameter.

 

Examples

SQL Server

CREATE PROC UT_MyUnitTest
@v_Debug BIT = 0
AS
BEGIN

EXEC DBTD_UNIT_TEST 'My Unit Test Suite'
DECLARE @UnitTestRunID INT,
   @Message VARCHAR(500)

EXEC dbo.DBTD_GET_UnitTestRunID @v_UnitTestRunID = @UnitTestRunID OUTPUT;
SET @Message = '@UnitTestRunID = ' + CAST(@UnitTestRunID AS VARCHAR(50));
--do something here
IF @v_Debug = 1 
BEGIN
  PRINT @Message
END

END 

 

See Also