| 379 | } |
| 380 | |
| 381 | func TestCollectionIsView(t *testing.T) { |
| 382 | t.Parallel() |
| 383 | |
| 384 | scenarios := []struct { |
| 385 | typ string |
| 386 | expected bool |
| 387 | }{ |
| 388 | {"unknown", false}, |
| 389 | {core.CollectionTypeBase, false}, |
| 390 | {core.CollectionTypeView, true}, |
| 391 | {core.CollectionTypeAuth, false}, |
| 392 | } |
| 393 | |
| 394 | for _, s := range scenarios { |
| 395 | t.Run(s.typ, func(t *testing.T) { |
| 396 | c := core.Collection{} |
| 397 | c.Type = s.typ |
| 398 | |
| 399 | if v := c.IsView(); v != s.expected { |
| 400 | t.Fatalf("Expected %v, got %v", s.expected, v) |
| 401 | } |
| 402 | }) |
| 403 | } |
| 404 | } |
| 405 | |
| 406 | func TestCollectionIsAuth(t *testing.T) { |
| 407 | t.Parallel() |