You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, when I run my test with AssertEqualsTable, the difference between binary values are listed as System.Byte[].
Is there any way to output binary in the human-readable form? Or, if not, is there convenient workaround?
In the test, after populating expected and actual tables, create views in which binary values are converted to the desired format. In AssertEqualsTable, replace original tables with views.
-- above this line goes your test and then:
EXEC(
'CREATE VIEW TableActual_Converted AS SELECT a, CONVERT(varchar(32), b, 2) AS b_hex, -- here comes the conversion c FROM TableActual;'
);
EXEC(
'CREATE VIEW TableExpected_Converted AS SELECT a, CONVERT(varchar(32), b, 2) AS b_hex, -- here comes the conversion c FROM TableExpected;'
);
EXEC tSQLt.AssertEqualsTable'TableExpected_Converted ', 'TableActual_Converted ';
It clutters the test a little bit, but works just fine.
I think the issue can be closed if there is no better solution in place. If there is - please, let me know.
Activity
ovcharenko-di commentedon Jul 16, 2025
DeepSeek gave me a workaround:
In the test, after populating expected and actual tables, create views in which binary values are converted to the desired format. In AssertEqualsTable, replace original tables with views.
It clutters the test a little bit, but works just fine.
I think the issue can be closed if there is no better solution in place. If there is - please, let me know.
Merge pull request #3 from masmgr/fix/issue-216-binary-output