Skip to content

Commit

Permalink
Add SubscriptionContainer tests (Azure#22348)
Browse files Browse the repository at this point in the history
  • Loading branch information
YalinLi0312 committed Jul 6, 2021
1 parent 96fef0c commit 1d1ebdc
Show file tree
Hide file tree
Showing 6 changed files with 235 additions and 164 deletions.

This file was deleted.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Azure.Core.TestFramework;
using NUnit.Framework;
Expand Down Expand Up @@ -31,7 +28,7 @@ public async Task List()
[RecordedTest]
public async Task TryGet()
{
var foo = await Client.GetSubscriptions().TryGetAsync("/subscriptions/"+ new Guid().ToString()).ConfigureAwait(false);
var foo = await Client.GetSubscriptions().TryGetAsync("/subscriptions/" + new Guid().ToString()).ConfigureAwait(false);
Assert.IsNull(foo);
string subscriptionId = Client.DefaultSubscription.Id.SubscriptionId;
var subscription = await Client.GetSubscriptions().TryGetAsync("/subscriptions/" + subscriptionId).ConfigureAwait(false);
Expand All @@ -41,7 +38,16 @@ public async Task TryGet()

[TestCase]
[RecordedTest]
public async Task DoesExist()
public async Task Get()
{
string subscriptionId = Client.DefaultSubscription.Id.SubscriptionId;
Subscription result = await Client.GetSubscriptions().GetAsync(subscriptionId).ConfigureAwait(false);
Assert.AreEqual(subscriptionId, result.Id.SubscriptionId);
}

[TestCase]
[RecordedTest]
public async Task DoesExist()
{
var expectFalse = await Client.GetSubscriptions().DoesExistAsync("/subscriptions/" + new Guid().ToString()).ConfigureAwait(false);
Assert.IsFalse(expectFalse);
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1d1ebdc

Please sign in to comment.