Debian Codegraph @

storage/2018-03-28/file/files/resource_id_test.go

raw symbols SCIP
1 package filesscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/file/files`/
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-03-28/file/files`/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/directory1/file1.txt",
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/directory1/file1.txt",
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/directory1/file1.txt",
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/directory1/file1.txt",
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-03-28/file/files`/NewWithEnvironment().(v.Environment)
34 actual := c.GetResourceIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/file/files`/Client#GetResourceID().("account1", "share1", "directory1", "file1.txt")
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-03-28/file/files`/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.file.core.chinacloudapi.cn/share1/directory1/file1.txt",
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.file.core.cloudapi.de/share1/directory1/file1.txt",
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.file.core.windows.net/share1/directory1/file1.txt",
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.file.core.usgovcloudapi.net/share1/directory1/file1.txt",
61 },
62 }
63
64 t.Logfscip-go gomod github.com/golang/go/src go1.13 testing/common#Logf().("[DEBUG] Top Level Files")
65 for _, v := range testData {
66 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.)
67 actual, err := ParseResourceIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/file/files`/ParseResourceID().(v.Input)
68 if err != nil {
69 t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(err)
70 }
71
72 if actual.AccountNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/file/files`/ResourceID#AccountName. != "account1" {
73 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-03-28/file/files`/ResourceID#AccountName.)
74 }
75 if actual.ShareNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/file/files`/ResourceID#ShareName. != "share1" {
76 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected Share Name to be `share1` but got %q", actual.ShareNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/file/files`/ResourceID#ShareName.)
77 }
78 if actual.DirectoryNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/file/files`/ResourceID#DirectoryName. != "directory1" {
79 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected Directory Name to be `directory1` but got %q", actual.DirectoryNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/file/files`/ResourceID#DirectoryName.)
80 }
81 if actual.FileNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/file/files`/ResourceID#FileName. != "file1.txt" {
82 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected File Name to be `file1.txt` but got %q", actual.FileNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/file/files`/ResourceID#FileName.)
83 }
84 }
85
86 testData = []struct {
87 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#
88 Input string
89 }{
90 {
91 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.,
92 Input: "https://account1.file.core.chinacloudapi.cn/share1/directory1/directory2/file1.txt",
93 },
94 {
95 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.,
96 Input: "https://account1.file.core.cloudapi.de/share1/directory1/directory2/file1.txt",
97 },
98 {
99 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.,
100 Input: "https://account1.file.core.windows.net/share1/directory1/directory2/file1.txt",
101 },
102 {
103 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.,
104 Input: "https://account1.file.core.usgovcloudapi.net/share1/directory1/directory2/file1.txt",
105 },
106 }
107
108 t.Logfscip-go gomod github.com/golang/go/src go1.13 testing/common#Logf().("[DEBUG] Nested Files")
109 for _, v := range testData {
110 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.)
111 actual, err := ParseResourceIDscip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/file/files`/ParseResourceID().(v.Input)
112 if err != nil {
113 t.Fatalscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatal().(err)
114 }
115
116 if actual.AccountNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/file/files`/ResourceID#AccountName. != "account1" {
117 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-03-28/file/files`/ResourceID#AccountName.)
118 }
119 if actual.ShareNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/file/files`/ResourceID#ShareName. != "share1" {
120 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected Share Name to be `share1` but got %q", actual.ShareNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/file/files`/ResourceID#ShareName.)
121 }
122 if actual.DirectoryNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/file/files`/ResourceID#DirectoryName. != "directory1/directory2" {
123 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected Directory Name to be `directory1/directory2` but got %q", actual.DirectoryNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/file/files`/ResourceID#DirectoryName.)
124 }
125 if actual.FileNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/file/files`/ResourceID#FileName. != "file1.txt" {
126 t.Fatalfscip-go gomod github.com/golang/go/src go1.13 testing/common#Fatalf().("Expected File Name to be `file1.txt` but got %q", actual.FileNamescip-go gomod github.com/tombuildsstuff/giovanni . `github.com/tombuildsstuff/giovanni/storage/2018-03-28/file/files`/ResourceID#FileName.)
127 }
128 }
129 }