Skip to content

An exception is raised when primary keys are different #8

@GillesTourreau

Description

@GillesTourreau

To reproduce the bug:

  • Create two database with a table "Table"
  • Create a primary key for each table "PK_DB1" and "PK_DB2"

When comparing the differences between the 2 databases a System.InvalidOperationException is raised with the Sequence contains more than one element message.

Stacktrace:

   at System.Linq.ThrowHelper.ThrowMoreThanOneElementException()
   at System.Linq.Enumerable.TryGetSingle[TSource](IEnumerable`1 source, Boolean& found)
   at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source)
   at PosInformatique.Testing.Databases.SqlServer.SqlObjectComparer.Visit(SqlTable table)
   at PosInformatique.Testing.Databases.SqlTable.Accept[TResult](ISqlObjectVisitor`1 visitor)
   at PosInformatique.Testing.Databases.SqlServer.SqlObjectComparer.Compare[TSqlObject](TSqlObject source, TSqlObject target)
   at PosInformatique.Testing.Databases.SqlServer.SqlObjectComparer.Compare[TSqlObject](IReadOnlyList`1 source, IReadOnlyList`1 target, Func`2 keySelector)
   at PosInformatique.Testing.Databases.SqlServer.SqlObjectComparer.Compare[TDifferences,TSqlObject](IReadOnlyList`1 source, IReadOnlyList`1 target, Func`2 keySelector, Func`2 factory)
   at PosInformatique.Testing.Databases.SqlServer.SqlObjectComparer.Compare(IReadOnlyList`1 source, IReadOnlyList`1 target)
   at PosInformatique.Testing.Databases.SqlServer.SqlServerDatabaseComparer.<CompareAsync>d__0.MoveNext()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions