mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 09:35:43 -05:00
* Make nullable warnings a per file opt-in * Remove unneeded compiler directives * Remove compiler directive for User Data
38 lines
1.4 KiB
C#
38 lines
1.4 KiB
C#
//
|
|
// Copyright (c) Microsoft. All rights reserved.
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
//
|
|
|
|
#nullable disable
|
|
|
|
using System;
|
|
using Microsoft.SqlTools.ResourceProvider.DefaultImpl;
|
|
using NUnit.Framework;
|
|
|
|
namespace Microsoft.SqlTools.ServiceLayer.UnitTests.ResourceProvider.Azure
|
|
{
|
|
/// <summary>
|
|
/// Tests for AzureSubscriptionContextWrapper to verify the wrapper on azure subscription class
|
|
/// </summary>
|
|
public class AzureSubscriptionContextTest
|
|
{
|
|
[Test]
|
|
public void SubscriptionNameShouldReturnNullGivenNullSubscription()
|
|
{
|
|
AzureSubscriptionContext subscriptionContext = new AzureSubscriptionContext(null);
|
|
Assert.True(subscriptionContext.SubscriptionName == String.Empty);
|
|
Assert.True(subscriptionContext.Subscription == null);
|
|
}
|
|
|
|
[Test]
|
|
public void SubscriptionNameShouldReturnCorrectValueGivenValidSubscription()
|
|
{
|
|
string name = Guid.NewGuid().ToString();
|
|
string tenantId = Guid.NewGuid().ToString();
|
|
AzureSubscriptionContext subscriptionContext = new AzureSubscriptionContext(new AzureSubscriptionIdentifier(null, null, name, null));
|
|
Assert.True(subscriptionContext.SubscriptionName == name);
|
|
Assert.True(subscriptionContext.Subscription != null);
|
|
}
|
|
}
|
|
}
|