Added tests in utils

This commit is contained in:
andronache
2020-11-25 11:55:27 +02:00
committed by Dan Christian Bogos
parent 318145d7c5
commit 56f9d16cc0
2 changed files with 36 additions and 7 deletions

View File

@@ -1514,13 +1514,6 @@ func TestIsURL(t *testing.T) {
}
}
func TestComputeHashError(t *testing.T) {
_, err := ComputeHash("test1;test2;test3")
if err != nil {
t.Errorf("Expecting: <nil>, received: %+v", err)
}
}
func TestComputeHashMatch(t *testing.T) {
lns, _ := ComputeHash("test1;test2;test3")
if err := VerifyHash(lns, "test1;test2;test3"); err != true {
@@ -1585,3 +1578,10 @@ func TestAESEncryptDecrypt(t *testing.T) {
t.Errorf("Expecting: <exampleText>, received: <%+v>", dString)
}
}
func TestBoolGenerator(t *testing.T) {
boolTest := BoolGenerator().RandomBool()
if boolTest != true && boolTest != false {
t.Errorf("Needs to be bool")
}
}