Skip to content

Commit 49b18a1

Browse files
committed
Fixing the Scenario tests for the Intune cmdlets.
1 parent 3ca552c commit 49b18a1

File tree

6 files changed

+156
-151
lines changed

6 files changed

+156
-151
lines changed

src/ResourceManager/Intune/Commands.Intune.Test/Commands.Intune.Test.csproj

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,15 @@
7777
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Resources.2.18.11-preview\lib\net40\Microsoft.Azure.ResourceManager.dll</HintPath>
7878
<Private>True</Private>
7979
</Reference>
80-
<Reference Include="Microsoft.Azure.Test.Framework, Version=1.0.5774.40163, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
80+
<Reference Include="Microsoft.Azure.Test.Framework, Version=1.0.5799.28345, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
8181
<SpecificVersion>False</SpecificVersion>
82-
<HintPath>..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5774.40163-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll</HintPath>
82+
<HintPath>..\..\..\packages\Microsoft.Azure.Test.Framework.1.0.5799.28345-prerelease\lib\net45\Microsoft.Azure.Test.Framework.dll</HintPath>
83+
<Private>True</Private>
8384
</Reference>
8485
<Reference Include="Microsoft.Azure.Test.HttpRecorder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
8586
<SpecificVersion>False</SpecificVersion>
86-
<HintPath>..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.3.0-preview\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
87+
<HintPath>..\..\..\packages\Microsoft.Azure.Test.HttpRecorder.1.4.0-preview\lib\net45\Microsoft.Azure.Test.HttpRecorder.dll</HintPath>
88+
<Private>True</Private>
8789
</Reference>
8890
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory">
8991
<SpecificVersion>False</SpecificVersion>
@@ -105,7 +107,8 @@
105107
<Private>True</Private>
106108
</Reference>
107109
<Reference Include="Microsoft.Rest.ClientRuntime.Azure.TestFramework, Version=0.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
108-
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.0.10.3-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
110+
<SpecificVersion>False</SpecificVersion>
111+
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.TestFramework.1.0.0-preview\lib\net45\Microsoft.Rest.ClientRuntime.Azure.TestFramework.dll</HintPath>
109112
<Private>True</Private>
110113
</Reference>
111114
<Reference Include="Moq">

src/ResourceManager/Intune/Commands.Intune.Test/ScenarioTests/IntuneTestController.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private void RunPsTestWorkflow(
7575
using (MockContext context = MockContext.Start(callingClassType, mockName))
7676
{
7777
SetupManagementClients(context);
78-
helper.SetupEnvironment(AzureModule.AzureResourceManager);
78+
//helper.SetupEnvironment(AzureModule.AzureResourceManager);
7979

8080
var callingClassName = callingClassType
8181
.Split(new[] { "." }, StringSplitOptions.RemoveEmptyEntries)
@@ -123,7 +123,9 @@ private IntuneResourceManagementClient GetIntuneManagementClient(MockContext con
123123

124124
internal static void InitializeEnvironment()
125125
{
126-
Environment.SetEnvironmentVariable("AZURE_TEST_MODE", "Playback");
126+
//Environment.SetEnvironmentVariable("TEST_CSM_ORGID_AUTHENTICATION", "SubscriptionId=None;Environment=Prod;[email protected];Password=XXXXXX");
127+
//AZURE_TEST_MODE = None, Record, Playback
128+
//Environment.SetEnvironmentVariable("AZURE_TEST_MODE", "Playback");
127129
}
128130
}
129131
}

src/ResourceManager/Intune/Commands.Intune.Test/ScenarioTests/IntuneTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818

1919
namespace Microsoft.Azure.Commands.Intune.Test.ScenarioTests
2020
{
21-
public class IntuneTests : TestBase
21+
public class IntuneTests : RMTestBase
2222
{
23-
[Fact(Skip = "Tenant only Authencation does not work with Scenario Test framework")]
23+
[Fact]
2424
public void TestE2EAndroidMAMPolicy()
2525
{
2626
IntuneTestController.NewInstance.RunPsTest("Test-E2EAndroidMAMPolicy");

src/ResourceManager/Intune/Commands.Intune.Test/ScenarioTests/IntuneTests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function Test-E2EAndroidMAMPolicy
3434
}
3535

3636
[Microsoft.Azure.Commands.Intune.IntuneBaseCmdlet]::AndroidPolicyIdsQueue.Enqueue("fa1a4d3b-2cca-406b-8956-6b6b32377641")
37-
New-AzureRmIntuneAndroidMAMPolicy -FriendlyName $policyName -Force
37+
New-AzureRmIntuneAndroidMAMPolicy -FriendlyName $policyName
3838

3939
$policies = Get-AzureRmIntuneAndroidMAMPolicy
4040
$policy = $policies[0]
@@ -45,9 +45,9 @@ function Test-E2EAndroidMAMPolicy
4545
$result = Get-AzureRmIntuneAndroidMAMApp
4646

4747
# Assert
48-
Assert-True { $result.Count -ge 10 }
48+
Assert-True { $result.Count -ge 1}
4949

50-
Add-AzureRmIntuneAndroidMAMPolicyApp -Name $policy.Name -AppName $result[0].Name -Force
50+
Add-AzureRmIntuneAndroidMAMPolicyApp -Name $policy.Name -AppName $result[0].Name
5151

5252
$targettedApps = Get-AzureRmIntuneAndroidMAMPolicyApp -Name $policy.Name
5353

0 commit comments

Comments
 (0)