Refactored test utils in VK module

This commit is contained in:
Artyom Belousov 2021-02-06 22:36:51 +03:00
parent d5f9a495b7
commit 121bb9fc9c
6 changed files with 124 additions and 112 deletions

19
internal/vk/test_cache.go Normal file
View file

@ -0,0 +1,19 @@
package vk
import "errors"
type testCache struct {
table map[string]string
}
func (t *testCache) Get(cardName string) (string, error) {
msg, ok := t.table[cardName]
if !ok {
return "", errors.New("test")
}
return msg, nil
}
func (t *testCache) Set(cardName string, message string) {
t.table[cardName] = message
}