Skip to content

Instantly share code, notes, and snippets.

@dcaponi
Created May 2, 2020 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcaponi/97abe0896b4fcf574301f158330da334 to your computer and use it in GitHub Desktop.
Save dcaponi/97abe0896b4fcf574301f158330da334 to your computer and use it in GitHub Desktop.
tf test example
package onelogin
import (
"testing"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
)
func TestAccApp_crud(t *testing.T) {
base := GetFixture("onelogin_app_example.tf", t)
update := GetFixture("onelogin_app_updated_example.tf", t)
resource.Test(t, resource.TestCase{
PreCheck: func() { TestAccPreCheck(t) },
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Config: base,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("onelogin_apps.basic_test", "name", "Form-Based Fitbit App"),
),
},
{
Config: update,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("onelogin_apps.basic_test", "name", "Updated Form-Based Fitbit App"),
),
},
},
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment