Added Confirm and Delete ECS tests.

This commit is contained in:
Ryan O'Hara-Reid
2017-04-03 19:21:49 +10:00
committed by Adrian Gallagher
parent 83b0bad4e6
commit 66cc94d310

View File

@@ -66,7 +66,7 @@ func TestConfirmJson(t *testing.T) {
if err != nil {
t.Errorf("Test failed. TestConfirmJson: %s", err)
}
err2 := config.ConfirmConfigJSON(testConfirmJson, result)
err2 := config.ConfirmConfigJSON(testConfirmJson, &result)
if err2 != nil {
t.Errorf("Test failed. TestConfirmJson: %s", err2)
}
@@ -74,3 +74,23 @@ func TestConfirmJson(t *testing.T) {
t.Errorf("Test failed. TestConfirmJson: Error Unmarshalling JSON")
}
}
func TestConfirmECS(t *testing.T) {
t.Parallel()
ECStest := []byte("THORS-HAMMER")
if !config.ConfirmECS(ECStest) {
t.Errorf("Test failed. TestConfirmECS: Error finding ECS.")
}
}
func TestRemoveECS(t *testing.T) {
t.Parallel()
ECStest := []byte("THORS-HAMMER")
isremoved := config.RemoveECS(ECStest)
if string(isremoved) != "" {
t.Errorf("Test failed. TestConfirmECS: Error ECS not deleted.")
}
}