Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public static string CreateStorageAccount(StorageManagementClient client, Resour
var createRequest = client.StorageAccounts.Create(resourceGroup.Name, storageName, new StorageAccountCreateParameters
{
Location = resourceGroup.Location,
Sku = new Sku { Name = SkuName.StandardLRS },
Sku = new Microsoft.Azure.Management.Storage.Models.Sku { Name = SkuName.StandardLRS },
Kind = Kind.Storage
});

Expand All @@ -92,27 +92,31 @@ public static string CreateStorageAccount(StorageManagementClient client, Resour
public static string CreateContainerRegistry(ContainerRegistryManagementClient client, ResourceGroup resourceGroup, string storageName, string storageKey)
{
string registryName = TestUtilities.GenerateName("acrregistry");
Registry registry = GetDefaultRegistryProperties(resourceGroup, storageName, storageKey);
RegistryCreateParameters parameters = GetDefaultRegistryCreateParameters(resourceGroup, storageName, storageKey);

var createRequest = client.Registries.CreateOrUpdate(resourceGroup.Name, registryName, registry);
var createRequest = client.Registries.Create(resourceGroup.Name, registryName, parameters);

return registryName;
}

public static Registry GetDefaultRegistryProperties(ResourceGroup resourceGroup, string storageName, string storageKey)
public static RegistryCreateParameters GetDefaultRegistryCreateParameters(ResourceGroup resourceGroup, string storageName, string storageKey)
{
Registry registry = new Registry
RegistryCreateParameters parameters = new RegistryCreateParameters
{
Location = resourceGroup.Location,
StorageAccount = new StorageAccountProperties
Sku = new Microsoft.Azure.Management.ContainerRegistry.Models.Sku
{
Name = "Basic"
},
StorageAccount = new StorageAccountParameters
{
Name = storageName,
AccessKey = storageKey
},
Tags = DefaultTags
};

return registry;
return parameters;
}

public static string GetStorageAccessKey(StorageManagementClient client, ResourceGroup resourceGroup, string storageName)
Expand All @@ -126,12 +130,15 @@ public static void VerifyRegistryProperties(Registry registry, string storageNam
Assert.NotNull(registry.Id);
Assert.NotNull(registry.Name);
Assert.NotNull(registry.Location);
Assert.NotNull(registry.Sku);
Assert.Equal(registry.Sku.Name, "Basic");
Assert.Equal(registry.Sku.Tier, Microsoft.Azure.Management.ContainerRegistry.Models.SkuTier.Basic);
Assert.Equal(registry.ProvisioningState, Microsoft.Azure.Management.ContainerRegistry.Models.ProvisioningState.Succeeded);
Assert.NotNull(registry.AdminUserEnabled);
Assert.NotNull(registry.LoginServer);
Assert.NotNull(registry.CreationDate);
Assert.NotNull(registry.StorageAccount);
Assert.NotNull(registry.StorageAccount.Name);
Assert.Null(registry.StorageAccount.AccessKey);

Assert.Equal(registry.StorageAccount.Name, storageName);

Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading