github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/builtin/providers/azurerm/import_arm_storage_account_test.go (about)

     1  package azurerm
     2  
     3  import (
     4  	"testing"
     5  
     6  	"fmt"
     7  
     8  	"github.com/hashicorp/terraform/helper/acctest"
     9  	"github.com/hashicorp/terraform/helper/resource"
    10  )
    11  
    12  func TestAccAzureRMStorageAccount_importBasic(t *testing.T) {
    13  	resourceName := "azurerm_storage_account.testsa"
    14  
    15  	ri := acctest.RandInt()
    16  	rs := acctest.RandString(4)
    17  	config := fmt.Sprintf(testAccAzureRMStorageAccount_basic, ri, rs)
    18  
    19  	resource.Test(t, resource.TestCase{
    20  		PreCheck:     func() { testAccPreCheck(t) },
    21  		Providers:    testAccProviders,
    22  		CheckDestroy: testCheckAzureRMStorageAccountDestroy,
    23  		Steps: []resource.TestStep{
    24  			resource.TestStep{
    25  				Config: config,
    26  			},
    27  
    28  			resource.TestStep{
    29  				ResourceName:      resourceName,
    30  				ImportState:       true,
    31  				ImportStateVerify: true,
    32  			},
    33  		},
    34  	})
    35  }