| 404 | } |
| 405 | |
| 406 | func TestCollectionIsAuth(t *testing.T) { |
| 407 | t.Parallel() |
| 408 | |
| 409 | scenarios := []struct { |
| 410 | typ string |
| 411 | expected bool |
| 412 | }{ |
| 413 | {"unknown", false}, |
| 414 | {core.CollectionTypeBase, false}, |
| 415 | {core.CollectionTypeView, false}, |
| 416 | {core.CollectionTypeAuth, true}, |
| 417 | } |
| 418 | |
| 419 | for _, s := range scenarios { |
| 420 | t.Run(s.typ, func(t *testing.T) { |
| 421 | c := core.Collection{} |
| 422 | c.Type = s.typ |
| 423 | |
| 424 | if v := c.IsAuth(); v != s.expected { |
| 425 | t.Fatalf("Expected %v, got %v", s.expected, v) |
| 426 | } |
| 427 | }) |
| 428 | } |
| 429 | } |
| 430 | |
| 431 | func TestCollectionPostScan(t *testing.T) { |
| 432 | t.Parallel() |