Returns currently running unit test name. Unit test name is the name of the actual unit test stored procedure.

Note: When manually running unit test value will be always returned as 'UnknownManualRun'

Arguments

  • v_UnitTestName - The currently running unit test name, NVARCHAR(128), OUTPUT parameter.

 

Examples

SQL Server

CREATE PROC UT_MyUnitTest
@v_Debug BIT = 1
AS
BEGIN

EXEC DBTD_UNIT_TEST 'My Unit Test Suite'
DECLARE @UnitTestName NVARCHAR(128),
   @Message VARCHAR(500)

EXEC dbo.DBTD_GET_UnitTestName @v_UnitTestName = @UnitTestName OUTPUT;
SET @Message = '@UnitTestName = ' + UnitTestName;
--do something here
IF @v_Debug = 1 
BEGIN
  PRINT @Message
END

END 

 

See Also