Skip to content

Commit cf9e1aa

Browse files
committed
Unit tests for Database/Pool sku name
1 parent 751c9bb commit cf9e1aa

File tree

2 files changed

+114
-0
lines changed

2 files changed

+114
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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.Sql.Database.Cmdlet;
16+
using Microsoft.Azure.Commands.Sql.Test.Utilities;
17+
using Microsoft.Azure.ServiceManagement.Common.Models;
18+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
19+
using System;
20+
using Microsoft.Azure.Commands.Sql.Database.Services;
21+
using Xunit;
22+
using Xunit.Abstractions;
23+
24+
namespace Microsoft.Azure.Commands.Sql.Test.UnitTests
25+
{
26+
public class AzureSqlDatabaseUnitTests
27+
{
28+
public AzureSqlDatabaseUnitTests(ITestOutputHelper output)
29+
{
30+
XunitTracingInterceptor.AddToContext(new XunitTracingInterceptor(output));
31+
}
32+
33+
[Fact]
34+
[Trait(Category.AcceptanceType, Category.CheckIn)]
35+
public void GetDatabaseSkuName()
36+
{
37+
Assert.Equal(
38+
"Basic",
39+
AzureSqlDatabaseAdapter.GetDatabaseSkuName("Basic"));
40+
Assert.Equal(
41+
"Standard",
42+
AzureSqlDatabaseAdapter.GetDatabaseSkuName("Standard"));
43+
Assert.Equal(
44+
"Premium",
45+
AzureSqlDatabaseAdapter.GetDatabaseSkuName("Premium"));
46+
Assert.Equal(
47+
"DataWarehouse",
48+
AzureSqlDatabaseAdapter.GetDatabaseSkuName("DataWarehouse"));
49+
Assert.Equal(
50+
"Stretch",
51+
AzureSqlDatabaseAdapter.GetDatabaseSkuName("Stretch"));
52+
Assert.Equal(
53+
"GP",
54+
AzureSqlDatabaseAdapter.GetDatabaseSkuName("GeneralPurpose"));
55+
Assert.Equal(
56+
"BC",
57+
AzureSqlDatabaseAdapter.GetDatabaseSkuName("BusinessCritical"));
58+
}
59+
}
60+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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.Sql.ElasticPool.Cmdlet;
16+
using Microsoft.Azure.Commands.Sql.Test.Utilities;
17+
using Microsoft.Azure.ServiceManagement.Common.Models;
18+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
19+
using System;
20+
using Microsoft.Azure.Commands.Sql.ElasticPool.Services;
21+
using Xunit;
22+
using Xunit.Abstractions;
23+
24+
namespace Microsoft.Azure.Commands.Sql.Test.UnitTests
25+
{
26+
public class AzureSqlElasticPoolUnitTests
27+
{
28+
public AzureSqlElasticPoolUnitTests(ITestOutputHelper output)
29+
{
30+
XunitTracingInterceptor.AddToContext(new XunitTracingInterceptor(output));
31+
}
32+
33+
[Fact]
34+
[Trait(Category.AcceptanceType, Category.CheckIn)]
35+
public void GetPoolSkuName()
36+
{
37+
Assert.Equal(
38+
"BasicPool",
39+
AzureSqlElasticPoolAdapter.GetPoolSkuName("Basic"));
40+
Assert.Equal(
41+
"StandardPool",
42+
AzureSqlElasticPoolAdapter.GetPoolSkuName("Standard"));
43+
Assert.Equal(
44+
"PremiumPool",
45+
AzureSqlElasticPoolAdapter.GetPoolSkuName("Premium"));
46+
Assert.Equal(
47+
"GP",
48+
AzureSqlElasticPoolAdapter.GetPoolSkuName("GeneralPurpose"));
49+
Assert.Equal(
50+
"BC",
51+
AzureSqlElasticPoolAdapter.GetPoolSkuName("BusinessCritical"));
52+
}
53+
}
54+
}

0 commit comments

Comments
 (0)