summaryrefslogtreecommitdiff
path: root/internal/totp/helpers_test.go
blob: 060c775de2a6b2331e0f11bd50b98ca1ace03c1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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(""))
}