MCPcopy Index your code
hub / github.com/coder/coder / expectUpdateWorkspaceDeletedByID

Function expectUpdateWorkspaceDeletedByID

coderd/wsbuilder/wsbuilder_test.go:1519–1533  ·  view source on GitHub ↗

expectUpdateWorkspaceDeletedByID asserts a call to UpdateWorkspaceDeletedByID and runs the provided assertions against it. It also expects the follow-up SoftDeleteWorkspaceAgentsByWorkspaceID call that wsbuilder.Builder.Build now issues inside the same orphan-delete transaction.

(assertions func(params database.UpdateWorkspaceDeletedByIDParams))

Source from the content-addressed store, hash-verified

1517// SoftDeleteWorkspaceAgentsByWorkspaceID call that wsbuilder.Builder.Build now
1518// issues inside the same orphan-delete transaction.
1519func expectUpdateWorkspaceDeletedByID(assertions func(params database.UpdateWorkspaceDeletedByIDParams)) func(mTx *dbmock.MockStore) {
1520 return func(mTx *dbmock.MockStore) {
1521 mTx.EXPECT().UpdateWorkspaceDeletedByID(gomock.Any(), gomock.Any()).
1522 Times(1).
1523 DoAndReturn(
1524 func(ctx context.Context, params database.UpdateWorkspaceDeletedByIDParams) error {
1525 assertions(params)
1526 return nil
1527 },
1528 )
1529 mTx.EXPECT().SoftDeleteWorkspaceAgentsByWorkspaceID(gomock.Any(), gomock.Any()).
1530 Times(1).
1531 Return(nil)
1532 }
1533}
1534
1535// expectGetProvisionerJobByID asserts a call to GetProvisionerJobByID
1536// and runs the provided assertions against it.

Callers 1

Calls 3

EXPECTMethod · 0.45

Tested by

no test coverage detected