ratio-spoof/internal/emulation/qbittorrent_test.go
ap-pauloafonso fa01ae1241 refactor
2021-02-09 20:32:32 -03:00

26 lines
442 B
Go

package emulation
import (
"strings"
"testing"
)
func TestGenerateRandomKey(T *testing.T) {
T.Run("Key has 8 length", func(t *testing.T) {
obj := NewQbitTorrent()
key := obj.Key()
if len(key) != 8 {
t.Error("Keys must have length of 8")
}
})
T.Run("Key must be uppercase", func(t *testing.T) {
obj := NewQbitTorrent()
key := obj.Key()
if strings.ToUpper(key) != key {
t.Error("Keys must be uppercase")
}
})
}