MCPcopy Index your code
hub / github.com/coder/coder / TestExpectedGroupEqual

Function TestExpectedGroupEqual

coderd/idpsync/group_test.go:601–743  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

599}
600
601func TestExpectedGroupEqual(t *testing.T) {
602 t.Parallel()
603
604 ids := coderdtest.NewDeterministicUUIDGenerator()
605 testCases := []struct {
606 Name string
607 A idpsync.ExpectedGroup
608 B idpsync.ExpectedGroup
609 Equal bool
610 }{
611 {
612 Name: "Empty",
613 A: idpsync.ExpectedGroup{},
614 B: idpsync.ExpectedGroup{},
615 Equal: true,
616 },
617 {
618 Name: "DifferentOrgs",
619 A: idpsync.ExpectedGroup{
620 OrganizationID: uuid.New(),
621 GroupID: ptr.Ref(ids.ID("g1")),
622 GroupName: nil,
623 },
624 B: idpsync.ExpectedGroup{
625 OrganizationID: uuid.New(),
626 GroupID: ptr.Ref(ids.ID("g1")),
627 GroupName: nil,
628 },
629 Equal: false,
630 },
631 {
632 Name: "SameID",
633 A: idpsync.ExpectedGroup{
634 OrganizationID: ids.ID("org"),
635 GroupID: ptr.Ref(ids.ID("g1")),
636 GroupName: nil,
637 },
638 B: idpsync.ExpectedGroup{
639 OrganizationID: ids.ID("org"),
640 GroupID: ptr.Ref(ids.ID("g1")),
641 GroupName: nil,
642 },
643 Equal: true,
644 },
645 {
646 Name: "DifferentIDs",
647 A: idpsync.ExpectedGroup{
648 OrganizationID: ids.ID("org"),
649 GroupID: ptr.Ref(uuid.New()),
650 GroupName: nil,
651 },
652 B: idpsync.ExpectedGroup{
653 OrganizationID: ids.ID("org"),
654 GroupID: ptr.Ref(uuid.New()),
655 GroupName: nil,
656 },
657 Equal: false,
658 },

Callers

nothing calls this directly

Calls 6

IDMethod · 0.95
RefFunction · 0.92
NewMethod · 0.65
RunMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected