Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added testcase for more functions in server/command.go #846

Open
wants to merge 1 commit into
base: add_server/command.go_testcases
Choose a base branch
from

Conversation

Kshitij-Katiyar
Copy link
Contributor

@Kshitij-Katiyar Kshitij-Katiyar commented Nov 5, 2024

Summary

Added testcase for the following api/command.go functions:

  • HandleMuteCommand
  • ArrayDifference
  • GetSubscribedFeatures
  • HandleSubscriptionsList

Parent PR

#845

@Kshitij-Katiyar Kshitij-Katiyar added the 2: Dev Review Requires review by a core committer label Nov 5, 2024
@Kshitij-Katiyar Kshitij-Katiyar self-assigned this Nov 5, 2024
@raghavaggarwal2308 raghavaggarwal2308 changed the title Added testcase for more functions in api/command.go Added testcase for more functions in server/command.go Nov 7, 2024
@@ -655,3 +655,353 @@ func TestHandleUnmuteAll(t *testing.T) {
})
}
}

func TestHandleMuteCommand(t *testing.T) {
mockKvStore, mockAPI, _, _, _ := GetTestSetup(t)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mockAPI is never used

Comment on lines +769 to +770
a []string
b []string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
a []string
b []string
arr1 []string
arr2 []string

setup: func() {
mockKvStore.EXPECT().Get(SubscriptionsKey, gomock.Any()).DoAndReturn(func(key string, value **Subscriptions) error {
*value = &Subscriptions{
Repositories: map[string][]*Subscription{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create a util for this, a similar thing is used below as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2: Dev Review Requires review by a core committer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants