Chore: Copy methods from sqlstore to org store (#55615)

* Chore: Copy methods from sqlstore to org store

* Rename method, add test

* Add comments of tests
This commit is contained in:
idafurjes
2022-09-22 19:02:55 +02:00
committed by GitHub
parent e981848026
commit 591df92265
7 changed files with 246 additions and 98 deletions
+18 -4
View File
@@ -54,10 +54,12 @@ func TestOrgService(t *testing.T) {
}
type FakeOrgStore struct {
ExpectedOrg *org.Org
ExpectedOrgID int64
ExpectedUserID int64
ExpectedError error
ExpectedOrg *org.Org
ExpectedOrgID int64
ExpectedUserID int64
ExpectedError error
ExpectedUserOrgs []*org.UserOrgDTO
ExpectedOrgs []*org.OrgDTO
}
func newOrgStoreFake() *FakeOrgStore {
@@ -91,3 +93,15 @@ func (f *FakeOrgStore) UpdateAddress(ctx context.Context, cmd *org.UpdateOrgAddr
func (f *FakeOrgStore) Delete(ctx context.Context, cmd *org.DeleteOrgCommand) error {
return f.ExpectedError
}
func (f *FakeOrgStore) GetUserOrgList(ctx context.Context, query *org.GetUserOrgListQuery) ([]*org.UserOrgDTO, error) {
return f.ExpectedUserOrgs, f.ExpectedError
}
func (f *FakeOrgStore) Search(ctx context.Context, query *org.SearchOrgsQuery) ([]*org.OrgDTO, error) {
return f.ExpectedOrgs, f.ExpectedError
}
func (f *FakeOrgStore) CreateWithMember(ctx context.Context, cmd *org.CreateOrgCommand) (*org.Org, error) {
return f.ExpectedOrg, f.ExpectedError
}