Test FgCrypto

This commit is contained in:
Jamil Bou Kheir
2020-06-17 23:14:51 -07:00
parent b670331c86
commit 887756fc04

View File

@@ -0,0 +1,17 @@
defmodule FgHttp.Util.FgCryptoTest do
use ExUnit.Case, async: true
alias FgHttp.Util.FgCrypto
describe "rand_string" do
test "it returns a string of default length" do
assert 16 == String.length(FgCrypto.rand_string())
end
test "it returns a string of proper length" do
for length <- [1, 32, 32_768] do
assert length == String.length(FgCrypto.rand_string(length))
end
end
end
end