chore: remove New----Builder from dbfake function names (#10882)

Drop "New" and "Builder" from the function names, in favor of the top-level resource created.  This shortens tests and gives a nice syntax.  Since everything is a builder, the prefix and suffix don't add much value and just make things harder to read.

I've also chosen to leave `Do()` as the function to insert into the database.  Even though it's a builder pattern, I fear `.Build()` might be confusing with Workspace Builds.  One other idea is `Insert()` but if we later add dbfake functions that update, this might be inconsistent.
This commit is contained in:
Spike Curtis
2023-11-29 11:06:04 +04:00
committed by GitHub
parent 48d69c9e60
commit 2dc565d5de
9 changed files with 49 additions and 49 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ func prepareTestGitSSH(ctx context.Context, t *testing.T) (*agentsdk.Client, str
require.NoError(t, err)
// setup template
r := dbfake.NewWorkspaceBuilder(t, db).
r := dbfake.Workspace(t, db).
Seed(database.Workspace{
OrganizationID: user.OrganizationID,
OwnerID: user.UserID,