| 1 | package sharesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/file/shares`/ |
| 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/file/shares`/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.file.core.chinacloudapi.cn/share1", |
| 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.file.core.cloudapi.de/share1", |
| 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.file.core.windows.net/share1", |
| 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.file.core.usgovcloudapi.net/share1", |
| 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/file/shares`/NewWithEnvironment().(v.Environment) |
| 34 | actual := c.GetResourceIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/file/shares`/Client#GetResourceID().("account1", "share1") |
| 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 TestGetResourceManagerResourceIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/file/shares`/TestGetResourceManagerResourceID().(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 | Expected 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 | Expected: "/subscriptions/11112222-3333-4444-5555-666677778888/resourceGroups/group1/providers/Microsoft.Storage/storageAccounts/account1/fileServices/default/shares/share1", |
| 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 | Expected: "/subscriptions/11112222-3333-4444-5555-666677778888/resourceGroups/group1/providers/Microsoft.Storage/storageAccounts/account1/fileServices/default/shares/share1", |
| 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 | Expected: "/subscriptions/11112222-3333-4444-5555-666677778888/resourceGroups/group1/providers/Microsoft.Storage/storageAccounts/account1/fileServices/default/shares/share1", |
| 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 | Expected: "/subscriptions/11112222-3333-4444-5555-666677778888/resourceGroups/group1/providers/Microsoft.Storage/storageAccounts/account1/fileServices/default/shares/share1", |
| 61 | }, |
| 62 | } |
| 63 | for _, v := range testData { |
| 64 | 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.) |
| 65 | c := NewWithEnvironmentscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/file/shares`/NewWithEnvironment().(v.Environment) |
| 66 | actual := c.GetResourceManagerResourceIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/file/shares`/Client#GetResourceManagerResourceID().("11112222-3333-4444-5555-666677778888", "group1", "account1", "share1") |
| 67 | if actual != v.Expected { |
| 68 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected the Resource Manager Resource ID to be %q but got %q", v.Expected, actual) |
| 69 | } |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | func TestParseResourceIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/file/shares`/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#) { |
| 74 | testData := []struct { |
| 75 | 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# |
| 76 | Input string |
| 77 | }{ |
| 78 | { |
| 79 | 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., |
| 80 | Input: "https://account1.file.core.chinacloudapi.cn/share1", |
| 81 | }, |
| 82 | { |
| 83 | 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., |
| 84 | Input: "https://account1.file.core.cloudapi.de/share1", |
| 85 | }, |
| 86 | { |
| 87 | 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., |
| 88 | Input: "https://account1.file.core.windows.net/share1", |
| 89 | }, |
| 90 | { |
| 91 | 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., |
| 92 | Input: "https://account1.file.core.usgovcloudapi.net/share1", |
| 93 | }, |
| 94 | } |
| 95 | for _, v := range testData { |
| 96 | 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.) |
| 97 | actual, err := ParseResourceIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/file/shares`/ParseResourceID().(v.Input) |
| 98 | if err != nil { |
| 99 | t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(err) |
| 100 | } |
| 101 | |
| 102 | if actual.AccountNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/file/shares`/ResourceID#AccountName. != "account1" { |
| 103 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected the account name to be `account1` but got %q", actual.AccountNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/file/shares`/ResourceID#AccountName.) |
| 104 | } |
| 105 | |
| 106 | if actual.ShareNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/file/shares`/ResourceID#ShareName. != "share1" { |
| 107 | t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected the share name to be `share1` but got %q", actual.ShareNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-11-09/file/shares`/ResourceID#ShareName.) |
| 108 | } |
| 109 | } |
| 110 | } |