Hi,
There seems to be a problem when trying to fake a table that contains columns whose type is a user defined data type.
The test fails with the message: "COLLATE clause cannot be used on user-defined data types".
Here is some code to reproduce:
EXEC tSQLt.NewTestClass 'fake_tables_with_uddt';
GO
CREATE TYPE fake_tables_with_uddt.some_type FROM NVARCHAR(20)
GO
CREATE TABLE fake_tables_with_uddt.some_table (some_column fake_tables_with_uddt.some_type)
go
CREATE PROCEDURE fake_tables_with_uddt.test_can_fake_table_with_uddt_column
AS
BEGIN
EXEC tSQLt.FakeTable 'fake_tables_with_uddt.some_table';
END
GO
EXEC tSQLt.RunTestClass 'fake_tables_with_uddt';
DROP TABLE fake_tables_with_uddt.some_table;
DROP TYPE fake_tables_with_uddt.some_type;
EXEC tSQLt.DropClass 'fake_tables_with_uddt';
As a little extra: DropClass does not drop uddts. Thats why there are the extra drop statements for the table and the uddt just before the DropClass.
I assume that this only applys to uddts that with an underlying type of varchar, nvarchar and whatever else might have a collation.
Any plans on changing this behavior?
Regards
r