From 887756fc049d91a2921fbdb1f4af2f263fb982a2 Mon Sep 17 00:00:00 2001 From: Jamil Bou Kheir Date: Wed, 17 Jun 2020 23:14:51 -0700 Subject: [PATCH] Test FgCrypto --- .../test/fg_http/util/fg_crypto_test.exs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 apps/fg_http/test/fg_http/util/fg_crypto_test.exs diff --git a/apps/fg_http/test/fg_http/util/fg_crypto_test.exs b/apps/fg_http/test/fg_http/util/fg_crypto_test.exs new file mode 100644 index 000000000..eb97c67b2 --- /dev/null +++ b/apps/fg_http/test/fg_http/util/fg_crypto_test.exs @@ -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