(t *testing.T)
| 264 | } |
| 265 | |
| 266 | func TestBatchOperations(t *testing.T) { |
| 267 | test.RunStorageTests(evTestcases, t, func(ctx context.Context) { |
| 268 | mainDAO, err := manager.Resolve[meta.DAO](ctx) |
| 269 | if err != nil { |
| 270 | panic(err) |
| 271 | } |
| 272 | mockDAO := mainDAO.GetEntityValueDao() |
| 273 | |
| 274 | Convey("Create Entity Values Batch", t, func() { |
| 275 | createdEntity, err := createTestEntity(ctx, mockDAO, "Batch Entity") |
| 276 | So(err, ShouldBeNil) |
| 277 | |
| 278 | values := []*idm.EntityValue{ |
| 279 | {Label: "Batch Value 1", EntityUuid: createdEntity.Uuid}, |
| 280 | {Label: "Batch Value 2", EntityUuid: createdEntity.Uuid}, |
| 281 | {Label: "Batch Value 3", EntityUuid: createdEntity.Uuid}, |
| 282 | } |
| 283 | |
| 284 | created, err := mockDAO.CreateEntityValues(ctx, values) |
| 285 | So(err, ShouldBeNil) |
| 286 | So(created, ShouldHaveLength, 3) |
| 287 | for i, val := range created { |
| 288 | So(val.Uuid, ShouldNotBeEmpty) |
| 289 | So(val.Label, ShouldEqual, values[i].Label) |
| 290 | So(val.EntityUuid, ShouldEqual, createdEntity.Uuid) |
| 291 | } |
| 292 | }) |
| 293 | |
| 294 | Convey("Create Entity Values Batch Empty", t, func() { |
| 295 | created, err := mockDAO.CreateEntityValues(ctx, []*idm.EntityValue{}) |
| 296 | So(err, ShouldBeNil) |
| 297 | So(created, ShouldHaveLength, 0) |
| 298 | }) |
| 299 | }) |
| 300 | } |
| 301 | |
| 302 | func TestDeleteOperations(t *testing.T) { |
| 303 | test.RunStorageTests(evTestcases, t, func(ctx context.Context) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…