go.mondoo.com/cnquery@v0.0.0-20231005093811-59568235f6ea/providers/network/resources/dns_test.go (about) 1 // Copyright (c) Mondoo, Inc. 2 // SPDX-License-Identifier: BUSL-1.1 3 4 package resources_test 5 6 import ( 7 "testing" 8 9 "github.com/stretchr/testify/assert" 10 ) 11 12 func TestResource_DNS(t *testing.T) { 13 res := x.TestQuery(t, "dns(\"mondoo.com\").mx") 14 assert.NotEmpty(t, res) 15 } 16 17 func TestResource_DomainName(t *testing.T) { 18 res := x.TestQuery(t, "domainName") 19 assert.NotEmpty(t, res) 20 res = x.TestQuery(t, "domainName(\"mondoo.com\").tld") 21 assert.Equal(t, "com", string(res[0].Result().Data.Value)) 22 }