// Copyright (C) 2019 Marius Schellenberger

package otp

import (
	"testing"
)

func TestNew(t *testing.T) {
	_, err := New("admin")
	if err != nil {
		t.Error(err)
	}
}

func TestImageSecretFromURL(t *testing.T) {
	r, _ := New("admin")
	_, secret, err := ImageSecretFromURL(r.URL)
	if err != nil {
		t.Error(err)
	}
	if secret != r.Secret {
		t.Error("secret is not equal")
	}
}
