Comments
4 comments
-
What are the contents of the test stored procedure?
I am guessing that AssertEqualsTablewill write its' own failure output so it's not necessary to also write your own failure message. -
Hi bootieday,
We've just released a beta build of SQL Test that should fix your issue with the duplication of test results in the messages window:
http://www.red-gate.com/MessageBoard/viewtopic.php?p=67784
Please let us know if this works for you!
Best regards,
David -
Here is a simplified version of what produces the doubled output. I tested it by removing the @FailMsg parameter and it is still doubled.
-- Tests the case of no rows returned from the dependent tables referenced by SELECT
-- For test case examples, see: http://tsqlt.org/user-guide/tsqlt-tutorial/
ALTER PROCEDURE [DependentTablesTests].[test no rows in SELECT]
AS
BEGIN
IF OBJECT_ID('expected') IS NOT NULL DROP TABLE expected
--Assemble
DECLARE @CID NVARCHAR(50)
SET @CID = '7000'
DECLARE @JID INT
SET @JID = 7000
EXEC tSQLt.FakeTable 'dbo', 'tblJC'
INSERT INTO dbo.tblJC
( JobID ,
ClientID ,
Cost
)
VALUES ( @JID , -- JobID - int
@CID , -- ClientID - nvarchar(50)
0.0 -- Cost - float
)
SELECT
*
INTO expected
FROM
dbo.tblJC
--Act
EXEC dbo.Proc_TESTED_CODE @JID, @CID
--Assert
EXEC tSQLt.AssertEqualsTable @Expected = N'expected', -- nvarchar(max)
@Actual = N'dbo.tblJC', -- nvarchar(max)
@FailMsg = N'Table tblJC actual does not match expected' -- nvarchar(max)
END; -
Hi bootieday,
Unfortunately I can't run your code to reproduce this, as it depends on tblJC and Proc_TESTED_CODE.
Can you confirm that you're using the latest 1.5 beta version of SQL Test?
Best regards,
David
Add comment
Please sign in to leave a comment.
Test Class: foo
TestClassName.TestName failed: UPDATE expected table does not match actual
|_m_|col1|col2|col3|
+---+----+----+----+
|< |2 |B |b |
|> |2 |B |b |
UPDATE expected table does not match actual
|_m_|col1|col2|col3|
+---+----+----+----+
|< |2 |B |b |
|> |2 |B |b |