| 1 | package blobsscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/blob/blobs`/ |
| 2 | |
| 3 | import ( |
| 4 | "testingscip-go gomod github.com/golang/go/src go1.13 testing/" |
| 5 | |
| 6 | "github.com/Azure/go-autorest/autorest/azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/" |
| 7 | ) |
| 8 | |
| 9 | func TestGetResourceIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/blob/blobs`/TestGetResourceID().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 10 | testData := []struct { |
| 11 | Environment azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.Environmentscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/Environment# |
| 12 | Expected string |
| 13 | }{ |
| 14 | { |
| 15 | Environment: azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.ChinaCloudscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/ChinaCloud., |
| 16 | Expected: "https://account1.blob.core.chinacloudapi.cn/container1/blob1.vhd", |
| 17 | }, |
| 18 | { |
| 19 | Environment: azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.GermanCloudscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/GermanCloud., |
| 20 | Expected: "https://account1.blob.core.cloudapi.de/container1/blob1.vhd", |
| 21 | }, |
| 22 | { |
| 23 | Environment: azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.PublicCloudscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/PublicCloud., |
| 24 | Expected: "https://account1.blob.core.windows.net/container1/blob1.vhd", |
| 25 | }, |
| 26 | { |
| 27 | Environment: azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.USGovernmentCloudscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/USGovernmentCloud., |
| 28 | Expected: "https://account1.blob.core.usgovcloudapi.net/container1/blob1.vhd", |
| 29 | }, |
| 30 | } |
| 31 | for _, v := range testData { |
| 32 | t.Logfscip-go gomod github.com/golang/go/src go1.13 testing/common#Logf().("[DEBUG] Testing Environment %q", v.Environment.Namescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/Environment#Name.) |
| 33 | c := NewWithEnvironmentscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/blob/blobs`/NewWithEnvironment().(v.Environment) |
| 34 | actual := c.GetResourceIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/blob/blobs`/Client#GetResourceID().("account1", "container1", "blob1.vhd") |
| 35 | if actual != v.Expected { |
| 36 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected the Resource ID to be %q but got %q", v.Expected, actual) |
| 37 | } |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | func TestParseResourceIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/blob/blobs`/TestParseResourceID().(t *testingscip-go gomod github.com/golang/go/src go1.13 testing/.Tscip-go gomod github.com/golang/go/src go1.13 testing/T#) { |
| 42 | testData := []struct { |
| 43 | Environment azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.Environmentscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/Environment# |
| 44 | Input string |
| 45 | }{ |
| 46 | { |
| 47 | Environment: azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.ChinaCloudscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/ChinaCloud., |
| 48 | Input: "https://account1.blob.core.chinacloudapi.cn/container1/blob1.vhd", |
| 49 | }, |
| 50 | { |
| 51 | Environment: azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.GermanCloudscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/GermanCloud., |
| 52 | Input: "https://account1.blob.core.cloudapi.de/container1/blob1.vhd", |
| 53 | }, |
| 54 | { |
| 55 | Environment: azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.PublicCloudscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/PublicCloud., |
| 56 | Input: "https://account1.blob.core.windows.net/container1/blob1.vhd", |
| 57 | }, |
| 58 | { |
| 59 | Environment: azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.USGovernmentCloudscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/USGovernmentCloud., |
| 60 | Input: "https://account1.blob.core.usgovcloudapi.net/container1/blob1.vhd", |
| 61 | }, |
| 62 | } |
| 63 | t.Logfscip-go gomod github.com/golang/go/src go1.13 testing/common#Logf().("[DEBUG] Top Level Files") |
| 64 | for _, v := range testData { |
| 65 | t.Logfscip-go gomod github.com/golang/go/src go1.13 testing/common#Logf().("[DEBUG] Testing Environment %q", v.Environment.Namescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/Environment#Name.) |
| 66 | actual, err := ParseResourceIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/blob/blobs`/ParseResourceID().(v.Input) |
| 67 | if err != nil { |
| 68 | t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(err) |
| 69 | } |
| 70 | |
| 71 | if actual.AccountNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/blob/blobs`/ResourceID#AccountName. != "account1" { |
| 72 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected Account Name to be `account1` but got %q", actual.AccountNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/blob/blobs`/ResourceID#AccountName.) |
| 73 | } |
| 74 | if actual.ContainerNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/blob/blobs`/ResourceID#ContainerName. != "container1" { |
| 75 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected Container Name to be `container1` but got %q", actual.ContainerNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/blob/blobs`/ResourceID#ContainerName.) |
| 76 | } |
| 77 | if actual.BlobNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/blob/blobs`/ResourceID#BlobName. != "blob1.vhd" { |
| 78 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected Blob Name to be `blob1.vhd` but got %q", actual.BlobNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/blob/blobs`/ResourceID#BlobName.) |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | testData = []struct { |
| 83 | Environment azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.Environmentscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/Environment# |
| 84 | Input string |
| 85 | }{ |
| 86 | { |
| 87 | Environment: azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.ChinaCloudscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/ChinaCloud., |
| 88 | Input: "https://account1.blob.core.chinacloudapi.cn/container1/example/blob1.vhd", |
| 89 | }, |
| 90 | { |
| 91 | Environment: azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.GermanCloudscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/GermanCloud., |
| 92 | Input: "https://account1.blob.core.cloudapi.de/container1/example/blob1.vhd", |
| 93 | }, |
| 94 | { |
| 95 | Environment: azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.PublicCloudscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/PublicCloud., |
| 96 | Input: "https://account1.blob.core.windows.net/container1/example/blob1.vhd", |
| 97 | }, |
| 98 | { |
| 99 | Environment: azurescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/.USGovernmentCloudscip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/USGovernmentCloud., |
| 100 | Input: "https://account1.blob.core.usgovcloudapi.net/container1/example/blob1.vhd", |
| 101 | }, |
| 102 | } |
| 103 | t.Logfscip-go gomod github.com/golang/go/src go1.13 testing/common#Logf().("[DEBUG] Nested Files") |
| 104 | for _, v := range testData { |
| 105 | t.Logfscip-go gomod github.com/golang/go/src go1.13 testing/common#Logf().("[DEBUG] Testing Environment %q", v.Environment.Namescip-go gomod github.com/Azure/go-autorest/autorest v0.11.19 `github.com/Azure/go-autorest/autorest/azure`/Environment#Name.) |
| 106 | actual, err := ParseResourceIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/blob/blobs`/ParseResourceID().(v.Input) |
| 107 | if err != nil { |
| 108 | t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(err) |
| 109 | } |
| 110 | |
| 111 | if actual.AccountNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/blob/blobs`/ResourceID#AccountName. != "account1" { |
| 112 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected Account Name to be `account1` but got %q", actual.AccountNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/blob/blobs`/ResourceID#AccountName.) |
| 113 | } |
| 114 | if actual.ContainerNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/blob/blobs`/ResourceID#ContainerName. != "container1" { |
| 115 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected Container Name to be `container1` but got %q", actual.ContainerNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/blob/blobs`/ResourceID#ContainerName.) |
| 116 | } |
| 117 | if actual.BlobNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/blob/blobs`/ResourceID#BlobName. != "example/blob1.vhd" { |
| 118 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected Blob Name to be `example/blob1.vhd` but got %q", actual.BlobNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/blob/blobs`/ResourceID#BlobName.) |
| 119 | } |
| 120 | } |
| 121 | } |