|
| 1 | +// ---------------------------------------------------------------------------------- |
| 2 | +// |
| 3 | +// Copyright Microsoft Corporation |
| 4 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +// you may not use this file except in compliance with the License. |
| 6 | +// You may obtain a copy of the License at |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// Unless required by applicable law or agreed to in writing, software |
| 9 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | +// See the License for the specific language governing permissions and |
| 12 | +// limitations under the License. |
| 13 | +// ---------------------------------------------------------------------------------- |
| 14 | + |
| 15 | +using Microsoft.Azure.Commands.ResourceManager.Common; |
| 16 | +using System.Collections.Generic; |
| 17 | +using Xunit; |
| 18 | + |
| 19 | +namespace Microsoft.Azure.Commands.ResourceManager.Test |
| 20 | +{ |
| 21 | + public class WildcardUnitTests |
| 22 | + { |
| 23 | + [Fact] |
| 24 | + public void ShouldGetByNameTest() |
| 25 | + { |
| 26 | + WildCardTestCmdlet cmdlet = new WildCardTestCmdlet(); |
| 27 | + Assert.False(cmdlet.ShouldGetByName(null, null)); |
| 28 | + Assert.False(cmdlet.ShouldGetByName("*", null)); |
| 29 | + Assert.False(cmdlet.ShouldGetByName("testrg*", null)); |
| 30 | + Assert.False(cmdlet.ShouldGetByName("*testrg*", null)); |
| 31 | + Assert.False(cmdlet.ShouldGetByName("test*rg", null)); |
| 32 | + Assert.False(cmdlet.ShouldGetByName("testrg", null)); |
| 33 | + |
| 34 | + Assert.False(cmdlet.ShouldGetByName(null, "*")); |
| 35 | + Assert.False(cmdlet.ShouldGetByName("*", "*")); |
| 36 | + Assert.False(cmdlet.ShouldGetByName("testrg*", "*")); |
| 37 | + Assert.False(cmdlet.ShouldGetByName("*testrg*", "*")); |
| 38 | + Assert.False(cmdlet.ShouldGetByName("test*rg", "*")); |
| 39 | + Assert.False(cmdlet.ShouldGetByName("testrg", "*")); |
| 40 | + |
| 41 | + Assert.False(cmdlet.ShouldGetByName(null, "testname*")); |
| 42 | + Assert.False(cmdlet.ShouldGetByName("*", "testname*")); |
| 43 | + Assert.False(cmdlet.ShouldGetByName("testrg*", "testname*")); |
| 44 | + Assert.False(cmdlet.ShouldGetByName("*te?strg*", "testname*")); |
| 45 | + Assert.False(cmdlet.ShouldGetByName("test*rg", "testname*")); |
| 46 | + Assert.False(cmdlet.ShouldGetByName("testrg", "testname*")); |
| 47 | + |
| 48 | + Assert.False(cmdlet.ShouldGetByName(null, "*testname*")); |
| 49 | + Assert.False(cmdlet.ShouldGetByName("*", "*testname*")); |
| 50 | + Assert.False(cmdlet.ShouldGetByName("testrg*", "*testname*")); |
| 51 | + Assert.False(cmdlet.ShouldGetByName("*testrg*", "*testname*")); |
| 52 | + Assert.False(cmdlet.ShouldGetByName("test*rg", "*testname*")); |
| 53 | + Assert.False(cmdlet.ShouldGetByName("testrg", "*testname*")); |
| 54 | + |
| 55 | + Assert.False(cmdlet.ShouldGetByName(null, "testname")); |
| 56 | + Assert.False(cmdlet.ShouldGetByName("*", "testname")); |
| 57 | + Assert.False(cmdlet.ShouldGetByName("testrg*", "testname")); |
| 58 | + Assert.False(cmdlet.ShouldGetByName("*testrg*", "testname")); |
| 59 | + Assert.False(cmdlet.ShouldGetByName("test*rg", "testname")); |
| 60 | + Assert.True(cmdlet.ShouldGetByName("testrg", "testname")); |
| 61 | + } |
| 62 | + |
| 63 | + [Fact] |
| 64 | + public void ShouldListByResourceGroupTest() |
| 65 | + { |
| 66 | + WildCardTestCmdlet cmdlet = new WildCardTestCmdlet(); |
| 67 | + Assert.False(cmdlet.ShouldListByResourceGroup(null, null)); |
| 68 | + Assert.False(cmdlet.ShouldListByResourceGroup("*", null)); |
| 69 | + Assert.False(cmdlet.ShouldListByResourceGroup("testrg*", null)); |
| 70 | + Assert.False(cmdlet.ShouldListByResourceGroup("*testrg*", null)); |
| 71 | + Assert.False(cmdlet.ShouldListByResourceGroup("test*rg", null)); |
| 72 | + Assert.True(cmdlet.ShouldListByResourceGroup("testrg", null)); |
| 73 | + |
| 74 | + Assert.False(cmdlet.ShouldListByResourceGroup(null, "*")); |
| 75 | + Assert.False(cmdlet.ShouldListByResourceGroup("*", "*")); |
| 76 | + Assert.False(cmdlet.ShouldListByResourceGroup("testrg*", "*")); |
| 77 | + Assert.False(cmdlet.ShouldListByResourceGroup("*testrg*", "*")); |
| 78 | + Assert.False(cmdlet.ShouldListByResourceGroup("test*rg", "*")); |
| 79 | + Assert.True(cmdlet.ShouldListByResourceGroup("testrg", "*")); |
| 80 | + |
| 81 | + Assert.False(cmdlet.ShouldListByResourceGroup(null, "testname*")); |
| 82 | + Assert.False(cmdlet.ShouldListByResourceGroup("*", "testname*")); |
| 83 | + Assert.False(cmdlet.ShouldListByResourceGroup("testrg*", "testname*")); |
| 84 | + Assert.False(cmdlet.ShouldListByResourceGroup("*testrg*", "testname*")); |
| 85 | + Assert.False(cmdlet.ShouldListByResourceGroup("test*rg", "testname*")); |
| 86 | + Assert.True(cmdlet.ShouldListByResourceGroup("testrg", "testname*")); |
| 87 | + |
| 88 | + Assert.False(cmdlet.ShouldListByResourceGroup(null, "*testname*")); |
| 89 | + Assert.False(cmdlet.ShouldListByResourceGroup("*", "*testname*")); |
| 90 | + Assert.False(cmdlet.ShouldListByResourceGroup("testrg*", "*testname*")); |
| 91 | + Assert.False(cmdlet.ShouldListByResourceGroup("*testrg*", "*testname*")); |
| 92 | + Assert.False(cmdlet.ShouldListByResourceGroup("test*rg", "*testname*")); |
| 93 | + Assert.True(cmdlet.ShouldListByResourceGroup("testrg", "*testname*")); |
| 94 | + |
| 95 | + Assert.False(cmdlet.ShouldListByResourceGroup(null, "testname")); |
| 96 | + Assert.False(cmdlet.ShouldListByResourceGroup("*", "testname")); |
| 97 | + Assert.False(cmdlet.ShouldListByResourceGroup("testrg*", "testname")); |
| 98 | + Assert.False(cmdlet.ShouldListByResourceGroup("*testrg*", "testname")); |
| 99 | + Assert.False(cmdlet.ShouldListByResourceGroup("test*rg", "testname")); |
| 100 | + Assert.False(cmdlet.ShouldListByResourceGroup("testrg", "testname")); |
| 101 | + } |
| 102 | + |
| 103 | + [Fact] |
| 104 | + public void ShouldListBySubscriptionTest() |
| 105 | + { |
| 106 | + WildCardTestCmdlet cmdlet = new WildCardTestCmdlet(); |
| 107 | + Assert.True(cmdlet.ShouldListBySubscription(null, null)); |
| 108 | + Assert.True(cmdlet.ShouldListBySubscription("*", null)); |
| 109 | + Assert.True(cmdlet.ShouldListBySubscription("testrg*", null)); |
| 110 | + Assert.True(cmdlet.ShouldListBySubscription("*testrg*", null)); |
| 111 | + Assert.True(cmdlet.ShouldListBySubscription("test*rg", null)); |
| 112 | + Assert.False(cmdlet.ShouldListBySubscription("testrg", null)); |
| 113 | + |
| 114 | + Assert.True(cmdlet.ShouldListBySubscription(null, "*")); |
| 115 | + Assert.True(cmdlet.ShouldListBySubscription("*", "*")); |
| 116 | + Assert.True(cmdlet.ShouldListBySubscription("testrg*", "*")); |
| 117 | + Assert.True(cmdlet.ShouldListBySubscription("*testrg*", "*")); |
| 118 | + Assert.True(cmdlet.ShouldListBySubscription("tes*trg", "*")); |
| 119 | + Assert.False(cmdlet.ShouldListBySubscription("testrg", "*")); |
| 120 | + |
| 121 | + Assert.True(cmdlet.ShouldListBySubscription(null, "testname*")); |
| 122 | + Assert.True(cmdlet.ShouldListBySubscription("*", "testname*")); |
| 123 | + Assert.True(cmdlet.ShouldListBySubscription("t?estrg*", "testname*")); |
| 124 | + Assert.True(cmdlet.ShouldListBySubscription("tes[t]rg*", "testname*")); |
| 125 | + Assert.True(cmdlet.ShouldListBySubscription("test[r]g", "testname*")); |
| 126 | + Assert.False(cmdlet.ShouldListBySubscription("testrg", "testname*")); |
| 127 | + |
| 128 | + Assert.True(cmdlet.ShouldListBySubscription(null, "*testname*")); |
| 129 | + Assert.True(cmdlet.ShouldListBySubscription("*", "*testname*")); |
| 130 | + Assert.True(cmdlet.ShouldListBySubscription("testrg*", "*testname*")); |
| 131 | + Assert.True(cmdlet.ShouldListBySubscription("*testrg*", "*testname*")); |
| 132 | + Assert.True(cmdlet.ShouldListBySubscription("test*rg", "*testname*")); |
| 133 | + Assert.False(cmdlet.ShouldListBySubscription("testrg", "*testname*")); |
| 134 | + |
| 135 | + Assert.True(cmdlet.ShouldListBySubscription(null, "testname")); |
| 136 | + Assert.True(cmdlet.ShouldListBySubscription("*", "testname")); |
| 137 | + Assert.True(cmdlet.ShouldListBySubscription("testrg*", "testname")); |
| 138 | + Assert.True(cmdlet.ShouldListBySubscription("*testrg*", "testname")); |
| 139 | + Assert.True(cmdlet.ShouldListBySubscription("test*rg", "testname")); |
| 140 | + Assert.False(cmdlet.ShouldListBySubscription("testrg", "testname")); |
| 141 | + } |
| 142 | + |
| 143 | + [Fact] |
| 144 | + public void TopLevelWildcardFilterTest() |
| 145 | + { |
| 146 | + WildCardTestCmdlet cmdlet = new WildCardTestCmdlet(); |
| 147 | + |
| 148 | + // Id objects |
| 149 | + Assert.Single(cmdlet.TopLevelWildcardFilter("resourcegroup1", "test1", ReturnedResources)); |
| 150 | + Assert.Empty(cmdlet.TopLevelWildcardFilter("resourcegroup11", "test1", ReturnedResources)); |
| 151 | + Assert.Empty(cmdlet.TopLevelWildcardFilter("1", "test1", ReturnedResources)); |
| 152 | + Assert.Empty(cmdlet.TopLevelWildcardFilter("resourcegroup1", "test11", ReturnedResources)); |
| 153 | + Assert.Empty(cmdlet.TopLevelWildcardFilter("resourcegroup1", "1", ReturnedResources)); |
| 154 | + |
| 155 | + Assert.Equal(3, cmdlet.TopLevelWildcardFilter("r*g*", "test1", ReturnedResources).Count); |
| 156 | + Assert.Empty(cmdlet.TopLevelWildcardFilter("r*p", "test1", ReturnedResources)); |
| 157 | + Assert.Single(cmdlet.TopLevelWildcardFilter("r*1", "test1", ReturnedResources)); |
| 158 | + |
| 159 | + Assert.Equal(6, cmdlet.TopLevelWildcardFilter("resourcegroup1", "*", ReturnedResources).Count); |
| 160 | + Assert.Equal(2, cmdlet.TopLevelWildcardFilter("resourcegroup1", "*1", ReturnedResources).Count); |
| 161 | + |
| 162 | + Assert.Equal(11, cmdlet.TopLevelWildcardFilter("r*p*", "*", ReturnedResources).Count); |
| 163 | + Assert.Equal(6, cmdlet.TopLevelWildcardFilter("r*1", "*", ReturnedResources).Count); |
| 164 | + Assert.Equal(2, cmdlet.TopLevelWildcardFilter("r*1", "*1", ReturnedResources).Count); |
| 165 | + Assert.Equal(6, cmdlet.TopLevelWildcardFilter("r*1", "t*", ReturnedResources).Count); |
| 166 | + |
| 167 | + // ResourceId objects |
| 168 | + Assert.Single(cmdlet.TopLevelWildcardFilter("resourcegroup1", "test1", ReturnedResources1)); |
| 169 | + Assert.Empty(cmdlet.TopLevelWildcardFilter("resourcegroup11", "test1", ReturnedResources1)); |
| 170 | + Assert.Empty(cmdlet.TopLevelWildcardFilter("1", "test1", ReturnedResources1)); |
| 171 | + Assert.Empty(cmdlet.TopLevelWildcardFilter("resourcegroup1", "test11", ReturnedResources1)); |
| 172 | + Assert.Empty(cmdlet.TopLevelWildcardFilter("resourcegroup1", "1", ReturnedResources1)); |
| 173 | + |
| 174 | + Assert.Equal(3, cmdlet.TopLevelWildcardFilter("r*g*", "test1", ReturnedResources1).Count); |
| 175 | + Assert.Empty(cmdlet.TopLevelWildcardFilter("r*p", "test1", ReturnedResources1)); |
| 176 | + Assert.Single(cmdlet.TopLevelWildcardFilter("r*1", "test1", ReturnedResources1)); |
| 177 | + |
| 178 | + Assert.Equal(6, cmdlet.TopLevelWildcardFilter("resourcegroup1", "*", ReturnedResources1).Count); |
| 179 | + Assert.Equal(2, cmdlet.TopLevelWildcardFilter("resourcegroup1", "*1", ReturnedResources1).Count); |
| 180 | + |
| 181 | + Assert.Equal(11, cmdlet.TopLevelWildcardFilter("r*p*", "*", ReturnedResources1).Count); |
| 182 | + Assert.Equal(6, cmdlet.TopLevelWildcardFilter("r*1", "*", ReturnedResources1).Count); |
| 183 | + Assert.Equal(2, cmdlet.TopLevelWildcardFilter("r*1", "*1", ReturnedResources1).Count); |
| 184 | + Assert.Equal(6, cmdlet.TopLevelWildcardFilter("r*1", "t*", ReturnedResources1).Count); |
| 185 | + |
| 186 | + // ResourceGroupName/Name objects |
| 187 | + Assert.Single(cmdlet.TopLevelWildcardFilter("resourcegroup1", "test1", ReturnedResources2)); |
| 188 | + Assert.Empty(cmdlet.TopLevelWildcardFilter("resourcegroup11", "test1", ReturnedResources2)); |
| 189 | + Assert.Empty(cmdlet.TopLevelWildcardFilter("1", "test1", ReturnedResources2)); |
| 190 | + Assert.Empty(cmdlet.TopLevelWildcardFilter("resourcegroup1", "test11", ReturnedResources2)); |
| 191 | + Assert.Empty(cmdlet.TopLevelWildcardFilter("resourcegroup1", "1", ReturnedResources2)); |
| 192 | + |
| 193 | + Assert.Equal(3, cmdlet.TopLevelWildcardFilter("r*g*", "test1", ReturnedResources2).Count); |
| 194 | + Assert.Empty(cmdlet.TopLevelWildcardFilter("r*p", "test1", ReturnedResources2)); |
| 195 | + Assert.Single(cmdlet.TopLevelWildcardFilter("r*1", "test1", ReturnedResources2)); |
| 196 | + |
| 197 | + Assert.Equal(6, cmdlet.TopLevelWildcardFilter("resourcegroup1", "*", ReturnedResources2).Count); |
| 198 | + Assert.Equal(2, cmdlet.TopLevelWildcardFilter("resourcegroup1", "*1", ReturnedResources2).Count); |
| 199 | + |
| 200 | + Assert.Equal(11, cmdlet.TopLevelWildcardFilter("r*p*", "*", ReturnedResources2).Count); |
| 201 | + Assert.Equal(6, cmdlet.TopLevelWildcardFilter("r*1", "*", ReturnedResources2).Count); |
| 202 | + Assert.Equal(2, cmdlet.TopLevelWildcardFilter("r*1", "*1", ReturnedResources2).Count); |
| 203 | + Assert.Equal(6, cmdlet.TopLevelWildcardFilter("r*1", "t*", ReturnedResources2).Count); |
| 204 | + } |
| 205 | + |
| 206 | + [Fact] |
| 207 | + public void SubResourceWildcardFilterTest() |
| 208 | + { |
| 209 | + WildCardTestCmdlet cmdlet = new WildCardTestCmdlet(); |
| 210 | + |
| 211 | + // Id objects |
| 212 | + Assert.Equal(3, cmdlet.SubResourceWildcardFilter("test1", ReturnedResources).Count); |
| 213 | + Assert.Empty(cmdlet.SubResourceWildcardFilter("test11", ReturnedResources)); |
| 214 | + Assert.Empty(cmdlet.SubResourceWildcardFilter("1", ReturnedResources)); |
| 215 | + |
| 216 | + Assert.Equal(11, cmdlet.SubResourceWildcardFilter("t*t*", ReturnedResources).Count); |
| 217 | + Assert.Single(cmdlet.SubResourceWildcardFilter("t*t", ReturnedResources)); |
| 218 | + Assert.Equal(4, cmdlet.SubResourceWildcardFilter("t*1", ReturnedResources).Count); |
| 219 | + |
| 220 | + // ResourceId objects |
| 221 | + Assert.Equal(3, cmdlet.SubResourceWildcardFilter("test1", ReturnedResources1).Count); |
| 222 | + Assert.Empty(cmdlet.SubResourceWildcardFilter("test11", ReturnedResources1)); |
| 223 | + Assert.Empty(cmdlet.SubResourceWildcardFilter("1", ReturnedResources1)); |
| 224 | + |
| 225 | + Assert.Equal(11, cmdlet.SubResourceWildcardFilter("t*t*", ReturnedResources1).Count); |
| 226 | + Assert.Single(cmdlet.SubResourceWildcardFilter("t*t", ReturnedResources1)); |
| 227 | + Assert.Equal(4, cmdlet.SubResourceWildcardFilter("t*1", ReturnedResources1).Count); |
| 228 | + |
| 229 | + // ResoureGroupName/Name objects |
| 230 | + Assert.Equal(3, cmdlet.SubResourceWildcardFilter("test1", ReturnedResources2).Count); |
| 231 | + Assert.Empty(cmdlet.SubResourceWildcardFilter("test11", ReturnedResources2)); |
| 232 | + Assert.Empty(cmdlet.SubResourceWildcardFilter("1", ReturnedResources2)); |
| 233 | + |
| 234 | + Assert.Equal(11, cmdlet.SubResourceWildcardFilter("t*t*", ReturnedResources2).Count); |
| 235 | + Assert.Single(cmdlet.SubResourceWildcardFilter("t*t", ReturnedResources2)); |
| 236 | + Assert.Equal(4, cmdlet.SubResourceWildcardFilter("t*1", ReturnedResources2).Count); |
| 237 | + } |
| 238 | + |
| 239 | + public List<TestResource> ReturnedResources = new List<TestResource>() |
| 240 | + { |
| 241 | + new TestResource("/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/resourcegroup1/providers/Microsoft.CognitiveServices/accounts/test1"), |
| 242 | + new TestResource("/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/resourcegroup1/providers/Microsoft.CognitiveServices/accounts/test2"), |
| 243 | + new TestResource("/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/resourcegroup1/providers/Microsoft.CognitiveServices/accounts/test3"), |
| 244 | + new TestResource("/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/resourcegroup1/providers/Microsoft.CognitiveServices/accounts/testing1"), |
| 245 | + new TestResource("/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/resourcegroup1/providers/Microsoft.CognitiveServices/accounts/testing2"), |
| 246 | + new TestResource("/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/resourcegroup1/providers/Microsoft.CognitiveServices/accounts/testing3"), |
| 247 | + new TestResource("/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/resourcegroup2/providers/Microsoft.CognitiveServices/accounts/test1"), |
| 248 | + new TestResource("/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/resourcegroup2/providers/Microsoft.CognitiveServices/accounts/test2"), |
| 249 | + new TestResource("/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/resourcegroup2/providers/Microsoft.CognitiveServices/accounts/test3"), |
| 250 | + new TestResource("/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/resourcegrouptest/providers/Microsoft.CognitiveServices/accounts/test1"), |
| 251 | + new TestResource("/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/resourcegrouptest/providers/Microsoft.CognitiveServices/accounts/testdifferent") |
| 252 | + }; |
| 253 | + |
| 254 | + public List<TestResource1> ReturnedResources1 = new List<TestResource1>() |
| 255 | + { |
| 256 | + new TestResource1("/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/resourcegroup1/providers/Microsoft.CognitiveServices/accounts/test1"), |
| 257 | + new TestResource1("/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/resourcegroup1/providers/Microsoft.CognitiveServices/accounts/test2"), |
| 258 | + new TestResource1("/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/resourcegroup1/providers/Microsoft.CognitiveServices/accounts/test3"), |
| 259 | + new TestResource1("/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/resourcegroup1/providers/Microsoft.CognitiveServices/accounts/testing1"), |
| 260 | + new TestResource1("/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/resourcegroup1/providers/Microsoft.CognitiveServices/accounts/testing2"), |
| 261 | + new TestResource1("/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/resourcegroup1/providers/Microsoft.CognitiveServices/accounts/testing3"), |
| 262 | + new TestResource1("/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/resourcegroup2/providers/Microsoft.CognitiveServices/accounts/test1"), |
| 263 | + new TestResource1("/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/resourcegroup2/providers/Microsoft.CognitiveServices/accounts/test2"), |
| 264 | + new TestResource1("/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/resourcegroup2/providers/Microsoft.CognitiveServices/accounts/test3"), |
| 265 | + new TestResource1("/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/resourcegrouptest/providers/Microsoft.CognitiveServices/accounts/test1"), |
| 266 | + new TestResource1("/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/resourcegrouptest/providers/Microsoft.CognitiveServices/accounts/testdifferent") |
| 267 | + }; |
| 268 | + |
| 269 | + public List<TestResource2> ReturnedResources2 = new List<TestResource2>() |
| 270 | + { |
| 271 | + new TestResource2("resourcegroup1","test1"), |
| 272 | + new TestResource2("resourcegroup1","test2"), |
| 273 | + new TestResource2("resourcegroup1","test3"), |
| 274 | + new TestResource2("resourcegroup1","testing1"), |
| 275 | + new TestResource2("resourcegroup1","testing2"), |
| 276 | + new TestResource2("resourcegroup1","testing3"), |
| 277 | + new TestResource2("resourcegroup2","test1"), |
| 278 | + new TestResource2("resourcegroup2","test2"), |
| 279 | + new TestResource2("resourcegroup2","test3"), |
| 280 | + new TestResource2("resourcegrouptest","test1"), |
| 281 | + new TestResource2("resourcegrouptest","testdifferent") |
| 282 | + }; |
| 283 | + } |
| 284 | + |
| 285 | + public class WildCardTestCmdlet : AzureRMCmdlet |
| 286 | + { |
| 287 | + public WildCardTestCmdlet() { } |
| 288 | + } |
| 289 | + |
| 290 | + public class TestResource |
| 291 | + { |
| 292 | + public TestResource(string Id) |
| 293 | + { |
| 294 | + this.Id = Id; |
| 295 | + } |
| 296 | + |
| 297 | + public string Id { get; set; } |
| 298 | + } |
| 299 | + |
| 300 | + public class TestResource1 |
| 301 | + { |
| 302 | + public TestResource1(string Id) |
| 303 | + { |
| 304 | + this.ResourceId = Id; |
| 305 | + } |
| 306 | + |
| 307 | + public string ResourceId { get; set; } |
| 308 | + } |
| 309 | + |
| 310 | + public class TestResource2 |
| 311 | + { |
| 312 | + public TestResource2(string ResourceGroupName, string Name) |
| 313 | + { |
| 314 | + this.ResourceGroupName = ResourceGroupName; |
| 315 | + this.Name = Name; |
| 316 | + } |
| 317 | + |
| 318 | + public string ResourceGroupName { get; set; } |
| 319 | + |
| 320 | + public string Name { get; set; } |
| 321 | + } |
| 322 | +} |
0 commit comments