Created
July 3, 2019 21:54
-
-
Save agnaite/45c954f5be5a9b93a5a9f2f34508f6a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package checker | |
import ( | |
"fmt" | |
"testing" | |
"github.com/heroku/runtime/acm/domain" | |
"github.com/heroku/runtime/lib/testlog" | |
"github.com/heroku/x/go-kit/metrics/provider/discard" | |
) | |
func TestNoopValidator(t *testing.T) { | |
logger, _ := testlog.NewNullLogger() | |
results := []Result{ | |
Result{Domain: "test.com", Reason: "I am a valid Reason"}, | |
} | |
n := &NoopValidator{ | |
Logger: logger, | |
MetricsProvider: discard.New(), | |
Prefix: "caa-checker", | |
Checker: &mockValidator{Results: results}, | |
} | |
r := n.Check([]domain.Domain{}) | |
fmt.Printf("%+v ", r) | |
} | |
type mockValidator struct { | |
Results []Result | |
} | |
func (m *mockValidator) Check(domains []domain.Domain) Results { | |
return m.Results | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment