* fix: remove unused attribute types and functions from backup models * fix: update API client references to use sqlserverflexalpha package * fix: update package references to use sqlserverflexalpha and modify user data source model * fix: add sqlserverflexalpha user data source to provider * fix: add sqlserverflexalpha user resource and update related functionality * chore: add stackit_sqlserverflexalpha_user resource and instance_id variable * fix: refactor sqlserverflexalpha user resource and enhance schema with status and default_database * chore: remove not needed service files * chore: cleanup import in utils * fix: provider name change * fix: clone missing doc files * fix: docs adjustments * fix: docs CI scripts * fix: docs naming * fix: remove guides from docs * fix: adjust examples * fix: remove obsolete doc templates * fix: docs adjustments * fix: add missing doc file * fix: temp rename file --------- Co-authored-by: Andre Harms <andre.harms@stackit.cloud> Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
50 lines
992 B
Go
50 lines
992 B
Go
// Copyright (c) STACKIT
|
|
|
|
package testutil
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/hashicorp/terraform-plugin-testing/config"
|
|
)
|
|
|
|
func TestConvertConfigVariable(t *testing.T) {
|
|
tests := []struct {
|
|
name string
|
|
variable config.Variable
|
|
want string
|
|
}{
|
|
{
|
|
name: "string",
|
|
variable: config.StringVariable("test"),
|
|
want: "test",
|
|
},
|
|
{
|
|
name: "bool: true",
|
|
variable: config.BoolVariable(true),
|
|
want: "true",
|
|
},
|
|
{
|
|
name: "bool: false",
|
|
variable: config.BoolVariable(false),
|
|
want: "false",
|
|
},
|
|
{
|
|
name: "integer",
|
|
variable: config.IntegerVariable(10),
|
|
want: "10",
|
|
},
|
|
{
|
|
name: "quoted string",
|
|
variable: config.StringVariable(`instance =~ ".*"`),
|
|
want: `instance =~ ".*"`,
|
|
},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
if got := ConvertConfigVariable(tt.variable); got != tt.want {
|
|
t.Errorf("ConvertConfigVariable() = %v, want %v", got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|