Skip to content

SQLite: UniqueConstraintException.InnerException is no longer set #96

@jenscski-lexit

Description

@jenscski-lexit

When I updated to version 10.0.0 from 8.1.3 my tests started failing, because the InnerException of UniqueConstraintException is of type SqliteException with a given message.

In version 10.0.0 the UniqueConstraintException.InnerException is null.

My asserts are written like this.

 var exception = Assert.Throws<UniqueConstraintException>(() => DatabaseContext.SaveChanges());

 Assert.IsType<SqliteException>(exception.InnerException);

 Assert.Equal("SQLite Error 19: 'UNIQUE constraint failed: Product.Id'.", exception.InnerException.Message);

It fails on this line Assert.IsType<SqliteException>(exception.InnerException);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions