Skip to content

Commit a32a6e0

Browse files
committed
Use TestMockSupport.RunningMocked
1 parent e01c22a commit a32a6e0

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/DatabaseBackupTests.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
using Microsoft.Azure.ServiceManagemenet.Common.Models;
1717
using Microsoft.Azure.Test.HttpRecorder;
1818
using Microsoft.WindowsAzure.Commands.ScenarioTest;
19+
using Microsoft.WindowsAzure.Commands.Utilities.Common;
1920
using Xunit;
2021
using Xunit.Abstractions;
2122

@@ -38,7 +39,7 @@ public void TestListDatabaseRestorePoints()
3839
public void TestRestoreGeoBackup()
3940
{
4041
// Test cannot be re-recorded because it has hardcoded server name
41-
if (HttpMockServer.Mode == HttpRecorderMode.Playback)
42+
if (TestMockSupport.RunningMocked)
4243
{
4344
RunPowerShellTest("Test-RestoreGeoBackup");
4445
}
@@ -48,7 +49,7 @@ public void TestRestoreGeoBackup()
4849
public void TestRestoreDeletedDatabaseBackup()
4950
{
5051
// Test cannot be re-recorded because it has hardcoded server name
51-
if (HttpMockServer.Mode == HttpRecorderMode.Playback)
52+
if (TestMockSupport.RunningMocked)
5253
{
5354
RunPowerShellTest("Test-RestoreDeletedDatabaseBackup");
5455
}
@@ -58,7 +59,7 @@ public void TestRestoreDeletedDatabaseBackup()
5859
public void TestRestorePointInTimeBackup()
5960
{
6061
// Test cannot be re-recorded because it has hardcoded server name
61-
if (HttpMockServer.Mode == HttpRecorderMode.Playback)
62+
if (TestMockSupport.RunningMocked)
6263
{
6364
RunPowerShellTest("Test-RestorePointInTimeBackup");
6465
}
@@ -68,7 +69,7 @@ public void TestRestorePointInTimeBackup()
6869
public void TestServerBackupLongTermRetentionVault()
6970
{
7071
// Test cannot be re-recorded because it has hardcoded server name
71-
if (HttpMockServer.Mode == HttpRecorderMode.Playback)
72+
if (TestMockSupport.RunningMocked)
7273
{
7374
RunPowerShellTest("Test-ServerBackupLongTermRetentionVault");
7475
}
@@ -78,7 +79,7 @@ public void TestServerBackupLongTermRetentionVault()
7879
public void TestDatabaseBackupLongTermRetentionPolicy()
7980
{
8081
// Test cannot be re-recorded because it has hardcoded server name
81-
if (HttpMockServer.Mode == HttpRecorderMode.Playback)
82+
if (TestMockSupport.RunningMocked)
8283
{
8384
RunPowerShellTest("Test-DatabaseBackupLongTermRetentionPolicy");
8485
}
@@ -88,7 +89,7 @@ public void TestDatabaseBackupLongTermRetentionPolicy()
8889
public void TestRestoreLongTermRetentionBackup()
8990
{
9091
// Test cannot be re-recorded because it has hardcoded server name
91-
if (HttpMockServer.Mode == HttpRecorderMode.Playback)
92+
if (TestMockSupport.RunningMocked)
9293
{
9394
RunPowerShellTest("Test-RestoreLongTermRetentionBackup");
9495
}
@@ -98,7 +99,7 @@ public void TestRestoreLongTermRetentionBackup()
9899
public void TestDatabaseGeoBackupPolicy()
99100
{
100101
// Test cannot be re-recorded because it has hardcoded server name
101-
if (HttpMockServer.Mode == HttpRecorderMode.Playback)
102+
if (TestMockSupport.RunningMocked)
102103
{
103104
RunPowerShellTest("Test-DatabaseGeoBackupPolicy");
104105
}

src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/ElasticPoolCrudTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
using Microsoft.Azure.ServiceManagemenet.Common.Models;
1717
using Microsoft.Azure.Test.HttpRecorder;
1818
using Microsoft.WindowsAzure.Commands.ScenarioTest;
19+
using Microsoft.WindowsAzure.Commands.Utilities.Common;
1920
using Xunit;
2021
using Xunit.Abstractions;
2122

@@ -53,7 +54,7 @@ public void TestElasticPoolGet()
5354
public void TestElasticPoolMetricGet()
5455
{
5556
// Test cannot be re-recorded because it has hardcoded server name
56-
if (HttpMockServer.Mode == HttpRecorderMode.Playback)
57+
if (TestMockSupport.RunningMocked)
5758
{
5859
RunPowerShellTest("Test-GetElasticPoolMetric");
5960
}

src/ResourceManager/Sql/Commands.Sql.Test/ScenarioTests/IndexRecommendationTests.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
using Microsoft.Azure.ServiceManagemenet.Common.Models;
1717
using Microsoft.Azure.Test.HttpRecorder;
1818
using Microsoft.WindowsAzure.Commands.ScenarioTest;
19+
using Microsoft.WindowsAzure.Commands.Utilities.Common;
1920
using Xunit;
2021
using Xunit.Abstractions;
2122

@@ -32,7 +33,7 @@ public IndexRecommendationTests(ITestOutputHelper output) : base(output)
3233
public void TestGetIndexRecommendation()
3334
{
3435
// Test cannot be re-recorded because it has hardcoded server name
35-
if (HttpMockServer.Mode == HttpRecorderMode.Playback)
36+
if (TestMockSupport.RunningMocked)
3637
{
3738
RunPowerShellTest("Test-GetIndexRecommendations");
3839
}
@@ -43,7 +44,7 @@ public void TestGetIndexRecommendation()
4344
public void TestCreateIndex()
4445
{
4546
// Test cannot be re-recorded because it has hardcoded server name
46-
if (HttpMockServer.Mode == HttpRecorderMode.Playback)
47+
if (TestMockSupport.RunningMocked)
4748
{
4849
RunPowerShellTest("Test-CreateIndex");
4950
}

0 commit comments

Comments
 (0)