From 84941128b3132f6b064a4aca2f9862a1a39a2d5a Mon Sep 17 00:00:00 2001 From: mapl Date: Sat, 19 Oct 2024 10:57:40 +0200 Subject: [PATCH] add enable test --- resolver/sudn_resolver_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/resolver/sudn_resolver_test.go b/resolver/sudn_resolver_test.go index bfe3ca4b4..9c0a7a8d3 100644 --- a/resolver/sudn_resolver_test.go +++ b/resolver/sudn_resolver_test.go @@ -95,6 +95,24 @@ var _ = Describe("SudnResolver", Label("sudnResolver"), func() { return Entry(description, args...) } + It("should be true by default", func() { + Expect(sutConfig.IsEnabled()).Should(BeTrue()) + }) + + When("enabled", func() { + It("should be true", func() { + sutConfig.Enable = true + Expect(sutConfig.IsEnabled()).Should(BeTrue()) + }) + }) + + When("disabled", func() { + It("should be false", func() { + sutConfig.Enable = false + Expect(sutConfig.IsEnabled()).Should(BeFalse()) + }) + }) + DescribeTable("handled domains", func(qType dns.Type, qName string, expectedRCode int, extraMatchers ...types.GomegaMatcher) { resp, err := sut.Resolve(ctx, newRequest(qName, qType))