This project is read-only.

"The expected data set has some duplicated keys" error

Feb 13, 2015 at 5:37 AM
Hello,

I am getting the following error:

NBi.NUnit.Runtime.TestSuite.PTS DS DistrictEmployee:
NBi.NUnit.Runtime.CustomStackTraceErrorException : The expected data set has some duplicated keys. Check your keys definition or the result set defined in your assertion.

Here's part of the test case:
<assert>
            <equalTo>
                <column index="0" role="key" type="numeric"/>
                <column index="1" role="value" type="numeric"/>
                <column index="2" role="value" type="numeric"/>
                <column index="3" role="value" type="numeric"/>
                <column index="4" role="value" type="text"/>
                <query connectionString="Server=server;Database=database;Integrated Security=true">
                    <![CDATA[
                            SELECT [Column_FK] 
                                  ,[Column_FK]
                                  ,[Column3]
                                  ,[Column4]
                                  ,[Column5]
                            FROM [DB].[SCH].[TABLE]
                    ]]>
                </query>
            </equalTo>
        </assert>
Here are the column datatypes:
-int
-int
-int
-datetime
-varbinary

Is there something wrong with the roles or types I'm using in the column definition?
Feb 13, 2015 at 6:52 AM
As stated in the error message, the key that you've defined is not unique in your expected dataset. The type will not influence but the role will. Based on your column names are you sure that the second column shouldn't be with a role "key".