(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func TestBolt_Create(t *testing.T) { |
| 12 | |
| 13 | b, err := Init(true, "create.db", "bucketName") |
| 14 | if err != nil { |
| 15 | t.Fatal("error initializing database") |
| 16 | } |
| 17 | |
| 18 | for _, tt := range generateCreateTestCases() { |
| 19 | t.Run(tt.name, func(t *testing.T) { |
| 20 | |
| 21 | got, err := b.Create(context.Background(), tt.args.col, tt.args.req) |
| 22 | if (err != nil) != tt.wantErr { |
| 23 | t.Errorf("Create() error = %v, wantErr %v", err, tt.wantErr) |
| 24 | return |
| 25 | } |
| 26 | if got != tt.want { |
| 27 | t.Errorf("Create() got = %v, want %v", got, tt.want) |
| 28 | } |
| 29 | }) |
| 30 | } |
| 31 | utils.CloseTheCloser(b) |
| 32 | if err := os.Remove("create.db"); err != nil { |
| 33 | t.Error("error removing database file:", err) |
| 34 | } |
| 35 | } |
nothing calls this directly
no test coverage detected