github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/builtin/providers/azurerm/import_arm_container_registry_test.go (about)

     1  package azurerm
     2  
     3  import (
     4  	"fmt"
     5  	"testing"
     6  
     7  	"github.com/hashicorp/terraform/helper/acctest"
     8  	"github.com/hashicorp/terraform/helper/resource"
     9  )
    10  
    11  func TestAccAzureRMContainerRegistry_importBasic(t *testing.T) {
    12  	resourceName := "azurerm_container_registry.test"
    13  
    14  	ri := acctest.RandInt()
    15  	rs := acctest.RandString(4)
    16  	config := fmt.Sprintf(testAccAzureRMContainerRegistry_basic, ri, rs, ri)
    17  
    18  	resource.Test(t, resource.TestCase{
    19  		PreCheck:     func() { testAccPreCheck(t) },
    20  		Providers:    testAccProviders,
    21  		CheckDestroy: testCheckAzureRMContainerRegistryDestroy,
    22  		Steps: []resource.TestStep{
    23  			{
    24  				Config: config,
    25  			},
    26  
    27  			{
    28  				ResourceName:            resourceName,
    29  				ImportState:             true,
    30  				ImportStateVerify:       true,
    31  				ImportStateVerifyIgnore: []string{"storage_account"},
    32  			},
    33  		},
    34  	})
    35  }
    36  
    37  func TestAccAzureRMContainerRegistry_importComplete(t *testing.T) {
    38  	resourceName := "azurerm_container_registry.test"
    39  
    40  	ri := acctest.RandInt()
    41  	rs := acctest.RandString(4)
    42  	config := fmt.Sprintf(testAccAzureRMContainerRegistry_complete, ri, rs, ri)
    43  
    44  	resource.Test(t, resource.TestCase{
    45  		PreCheck:     func() { testAccPreCheck(t) },
    46  		Providers:    testAccProviders,
    47  		CheckDestroy: testCheckAzureRMContainerRegistryDestroy,
    48  		Steps: []resource.TestStep{
    49  			{
    50  				Config: config,
    51  			},
    52  
    53  			{
    54  				ResourceName:            resourceName,
    55  				ImportState:             true,
    56  				ImportStateVerify:       true,
    57  				ImportStateVerifyIgnore: []string{"storage_account"},
    58  			},
    59  		},
    60  	})
    61  }