-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Add ResourceGroupBuilder tests #21897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
10f6ad0
ccc17c7
5060f5c
9a9a651
7764cb5
832483a
3066cd2
9597dc7
86547b0
4fa650c
6f858c5
fb80156
4f1408d
0bcb9e4
2a78d80
89edf88
831972e
7ea58d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using Azure.Core.TestFramework; | ||
| using NUnit.Framework; | ||
|
|
||
| namespace Azure.ResourceManager.Core.Tests | ||
| { | ||
| public class ResourceGroupBuilderTests : ResourceManagerTestBase | ||
| { | ||
| public ResourceGroupBuilderTests(bool isAsync) | ||
| : base(isAsync)//, RecordedTestMode.Record) | ||
| { | ||
| } | ||
|
|
||
| [TestCase(null)] | ||
| [TestCase(" ")] | ||
| [RecordedTest] | ||
| public void CreateOrUpdate(string value) | ||
| { | ||
| Assert.ThrowsAsync<ArgumentException>(async () => _ = await Client.DefaultSubscription.GetResourceGroups().Construct(LocationData.WestUS2).CreateOrUpdateAsync(value)); | ||
| } | ||
|
|
||
| [TestCase(null)] | ||
| [TestCase(" ")] | ||
| [RecordedTest] | ||
| public void StartCreateOrUpdate(string value) | ||
| { | ||
| Assert.ThrowsAsync<ArgumentException>(async () => | ||
| { | ||
| var createOp = await Client.DefaultSubscription.GetResourceGroups().Construct(LocationData.WestUS2).StartCreateOrUpdateAsync(value); | ||
| _ = await createOp.WaitForCompletionAsync(); | ||
| }); | ||
| } | ||
|
|
||
| [TestCase] | ||
| [RecordedTest] | ||
| public void Build() | ||
| { | ||
| var location = LocationData.WestUS2; | ||
| var tags = new Dictionary<string, string>() | ||
| { | ||
| { "key", "value"} | ||
| }; | ||
| var managedBy = "managedBy"; | ||
| var rgData = Client.DefaultSubscription.GetResourceGroups().Construct(location, tags, managedBy).Build(); | ||
| Assert.AreEqual(location, rgData.Location); | ||
| Assert.AreEqual(tags, rgData.Tags); | ||
| Assert.AreEqual(managedBy, rgData.ManagedBy); | ||
| } | ||
| } | ||
| } | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.