mirror of https://github.com/authelia/authelia.git
16 lines
394 B
Go
16 lines
394 B
Go
package totp
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/authelia/otp"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestOTPStringToAlgo(t *testing.T) {
|
|
assert.Equal(t, otp.AlgorithmSHA1, otpStringToAlgo("SHA1"))
|
|
assert.Equal(t, otp.AlgorithmSHA256, otpStringToAlgo("SHA256"))
|
|
assert.Equal(t, otp.AlgorithmSHA512, otpStringToAlgo("SHA512"))
|
|
assert.Equal(t, otp.AlgorithmSHA1, otpStringToAlgo(""))
|
|
}
|