go.mondoo.com/cnquery@v0.0.0-20231005093811-59568235f6ea/providers/os/resources/windows/security_health_test.go (about)

     1  // Copyright (c) Mondoo, Inc.
     2  // SPDX-License-Identifier: BUSL-1.1
     3  
     4  package windows
     5  
     6  import (
     7  	"os"
     8  	"testing"
     9  
    10  	"github.com/stretchr/testify/assert"
    11  	"github.com/stretchr/testify/require"
    12  )
    13  
    14  func TestSecurityHealthPowershell(t *testing.T) {
    15  	r, err := os.Open("./testdata/security_center_health.json")
    16  	require.NoError(t, err)
    17  
    18  	health, err := ParseSecurityProviderHealth(r)
    19  	require.NoError(t, err)
    20  
    21  	assert.Equal(t, int64(2), health.Firewall.Code)
    22  	assert.Equal(t, "POOR", health.Firewall.Text)
    23  	assert.Equal(t, int64(0), health.AutoUpdate.Code)
    24  	assert.Equal(t, "GOOD", health.AutoUpdate.Text)
    25  	assert.Equal(t, int64(2), health.Uac.Code)
    26  	assert.Equal(t, "POOR", health.Uac.Text)
    27  }