Skip to content

Commit

Permalink
e2e/mysqlr: add more unique data (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
scbizu committed Jul 25, 2023
1 parent 44863af commit e8af3c5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions e2e/mysqlr/mysqlr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,27 @@ func TestBlogsCRUD(t *testing.T) {
})

t.Run("GetUniqueMultiKeyByBatch", func(t *testing.T) {
bl := &Blog{
Id: 2,
UserId: 1,
Title: "test2",
Content: "test",
Status: 1,
Readed: 0,
CreatedAt: time.Now(),
UpdatedAt: time.Now(),
}
_, err := BlogDBMgr(db).Create(ctx, bl)
assert.NoError(t, err)

bs, err := BlogDBMgr(db).FetchByUserIdTitles(ctx, []*UserIdTitleOfBlogUK{
{UserId: 1, Title: "test"},
})
assert.NoError(t, err)
assert.Equal(t, 1, len(bs))

_, err = BlogDBMgr(db).DeleteByPrimaryKey(ctx, 2, 1)
assert.NoError(t, err)
})

t.Run("GetByUniqueKeyNoRows", func(t *testing.T) {
Expand Down

0 comments on commit e8af3c5

Please sign in to comment.