the probelm
\nexpected call at /go/clan-service/repository/redis_reserved_name_test.go:25 doesn't match the argument at index 1.\n Got: index 1 redis command [SET test::clan::reservedname::my_name 69 NX EX 120]\n Want: redis command [SET test::clan::reservedname::my_name 69 NX EX 120]\n
the code under test
\nqualifiedRequestedName := fmt.Sprintf(\"%s::clan::reservedname::%s\", r.env, requestedName)\n\n// Check if the key (the requested name) already exists in redis, if not set it with TTL\nuserStr := strconv.FormatInt(int64(userID), 10)\nsetnxCmd := r.client.B().Set().Key(qualifiedRequestedName).Value(userStr).Nx().ExSeconds(reservationTTLSec).Build()\ndidSet, err := r.client.Do(ctx, setnxCmd).ToInt64()\n
How do I expect a index 1 redis command
rather than a plain old redis command
or am I barking up the wrong tree entirely?
Many thanks.
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Hi @tom-lkwd,
\nPlease try mock.Match(\"SET\", \"test::clan::reservedname::my_name\", \"69\", \"NX\", \"EX\", \"120\")
-
my test
the probelm
the code under test
How do I expect a Many thanks. |
Beta Was this translation helpful? Give feedback.
-
Hi @tom-lkwd, Please try |
Beta Was this translation helpful? Give feedback.
Hi @tom-lkwd,
Please try
mock.Match("SET", "test::clan::reservedname::my_name", "69", "NX", "EX", "120")