Skip to content

Commit eb709b0

Browse files
committed
converting MSTests to XUnit tests
1 parent 518c564 commit eb709b0

File tree

5 files changed

+52
-42
lines changed

5 files changed

+52
-42
lines changed

ChangeLog.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
2015.04.28 version 0.8.17
2+
* Azure HDInsight:
3+
* Added support for creating WindowsPaas cluster with RDP Access Enabled by default
4+
* Added cmdlets
5+
* Grant-AzureHdinsightRdpAccess
6+
* Revoke-AzureHdinsightRdpAccess
27
* Azure Batch
38
* Added cmdlets
49
* New-AzureBatchVMUser

src/ServiceManagement/HDInsight/Commands.HDInsight.Test/Commands.HDInsight.Test.csproj

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="..\..\..\packages\xunit.runner.visualstudio.2.0.0\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\..\..\packages\xunit.runner.visualstudio.2.0.0\build\net20\xunit.runner.visualstudio.props')" />
3+
<Import Project="..\..\..\packages\xunit.runner.visualstudio.2.1.0-beta1-build1051\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\..\..\packages\xunit.runner.visualstudio.2.1.0-beta1-build1051\build\net20\xunit.runner.visualstudio.props')" />
4+
<Import Project="..\..\..\packages\xunit.core.2.1.0-beta1-build2945\build\portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props" Condition="Exists('..\..\..\packages\xunit.core.2.1.0-beta1-build2945\build\portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props')" />
45
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
56
<PropertyGroup>
67
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -15,7 +16,7 @@
1516
<TargetFrameworkProfile />
1617
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\</SolutionDir>
1718
<RestorePackages>true</RestorePackages>
18-
<NuGetPackageImportStamp>3042119d</NuGetPackageImportStamp>
19+
<NuGetPackageImportStamp>c29245bf</NuGetPackageImportStamp>
1920
</PropertyGroup>
2021
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
2122
<DebugSymbols>true</DebugSymbols>
@@ -49,7 +50,7 @@
4950
<Reference Include="Hyak.Common">
5051
<HintPath>..\..\..\packages\Hyak.Common.1.0.2\lib\portable-net403+win+wpa81\Hyak.Common.dll</HintPath>
5152
</Reference>
52-
<Reference Include="Microsoft.Azure.Common">
53+
<Reference Include="Microsoft.Azure.Common">
5354
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll</HintPath>
5455
</Reference>
5556
<Reference Include="Microsoft.Azure.Common.Authentication">
@@ -96,7 +97,7 @@
9697
</Reference>
9798
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
9899
<Reference Include="Microsoft.WindowsAzure.Configuration, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
99-
<SpecificVersion>False</SpecificVersion>
100+
<SpecificVersion>False</SpecificVersion>
100101
<HintPath>..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.1.8.0.0\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll</HintPath>
101102
</Reference>
102103
<Reference Include="Microsoft.WindowsAzure.Management">
@@ -149,6 +150,15 @@
149150
<Reference Include="Microsoft.CSharp" />
150151
<Reference Include="System.Data" />
151152
<Reference Include="System.Xml" />
153+
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
154+
<HintPath>..\..\..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll</HintPath>
155+
</Reference>
156+
<Reference Include="xunit.assert">
157+
<HintPath>..\..\..\packages\xunit.assert.2.1.0-beta1-build2945\lib\portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.assert.dll</HintPath>
158+
</Reference>
159+
<Reference Include="xunit.core">
160+
<HintPath>..\..\..\packages\xunit.extensibility.core.2.1.0-beta1-build2945\lib\portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.dll</HintPath>
161+
</Reference>
152162
</ItemGroup>
153163
<ItemGroup>
154164
<Compile Include="HDInsight\CmdLetTests\AddConfigValuesCmdletTests.cs" />
@@ -249,7 +259,7 @@
249259
<Project>{5ee72c53-1720-4309-b54b-5fb79703195f}</Project>
250260
<Name>Commands.Common</Name>
251261
</ProjectReference>
252-
<ProjectReference Include="..\..\..\Common\Commands.ScenarioTests.Common\Commands.ScenarioTests.Common.csproj">
262+
<ProjectReference Include="..\..\..\Common\Commands.ScenarioTests.Common\Commands.ScenarioTests.Common.csproj">
253263
<Project>{c1bda476-a5cc-4394-914d-48b0ec31a710}</Project>
254264
<Name>Commands.ScenarioTests.Common</Name>
255265
</ProjectReference>
@@ -280,6 +290,7 @@
280290
<PropertyGroup>
281291
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
282292
</PropertyGroup>
283-
<Error Condition="!Exists('..\..\..\packages\xunit.runner.visualstudio.2.0.0\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\xunit.runner.visualstudio.2.0.0\build\net20\xunit.runner.visualstudio.props'))" />
293+
<Error Condition="!Exists('..\..\..\packages\xunit.core.2.1.0-beta1-build2945\build\portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\xunit.core.2.1.0-beta1-build2945\build\portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props'))" />
294+
<Error Condition="!Exists('..\..\..\packages\xunit.runner.visualstudio.2.1.0-beta1-build1051\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\xunit.runner.visualstudio.2.1.0-beta1-build1051\build\net20\xunit.runner.visualstudio.props'))" />
284295
</Target>
285296
</Project>

src/ServiceManagement/HDInsight/Commands.HDInsight.Test/HDInsight/CmdLetTests/GrantRdpAccessCmdletTests.cs

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
using System;
1616
using System.Collections.Generic;
1717
using System.Linq;
18-
using Microsoft.VisualStudio.TestTools.UnitTesting;
18+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
19+
using Xunit;
1920
using Microsoft.WindowsAzure.Commands.Test.Utilities.HDInsight.PowerShellTestAbstraction.Interfaces;
2021
using Microsoft.WindowsAzure.Commands.Test.Utilities.HDInsight.Utilities;
2122
using Microsoft.WindowsAzure.Management.HDInsight;
@@ -24,20 +25,15 @@
2425

2526
namespace Microsoft.WindowsAzure.Commands.Test.HDInsight.CmdLetTests
2627
{
27-
[TestClass]
28-
public class GrantRdpAccessCmdletTests : HDInsightTestCaseBase
28+
public class GrantRdpAccessCmdletTests : HDInsightTestCaseBase, IDisposable
2929
{
30-
[TestCleanup]
31-
public override void TestCleanup()
30+
public new void Dispose()
3231
{
3332
base.TestCleanup();
3433
}
3534

36-
[TestMethod]
37-
[TestCategory("CheckIn")]
38-
[TestCategory("Integration")]
39-
[TestCategory("PowerShell")]
40-
35+
[Fact]
36+
[Trait(Category.AcceptanceType, Category.CheckIn)]
4137
public void CanGrantRdpAccessToHDInsightCluster()
4238
{
4339
IHDInsightCertificateCredential creds = GetValidCredentials();
@@ -54,13 +50,12 @@ public void CanGrantRdpAccessToHDInsightCluster()
5450
.Invoke();
5551

5652
AzureHDInsightCluster accessgrantedCluster = GetCluster(creds, cluster.Name, runspace);
57-
Assert.IsNotNull(accessgrantedCluster);
58-
Assert.AreEqual(accessgrantedCluster.RdpUserName, TestCredentials.AzureUserName);
53+
Assert.NotNull(accessgrantedCluster);
54+
Assert.Equal(accessgrantedCluster.RdpUserName, TestCredentials.AzureUserName);
5955
}
6056
}
6157

62-
[TestInitialize]
63-
public override void Initialize()
58+
public GrantRdpAccessCmdletTests()
6459
{
6560
base.Initialize();
6661
}
@@ -95,8 +90,8 @@ internal static void RevokeRdpAccessToCluster(
9590
.Invoke();
9691

9792
AzureHDInsightCluster accessRevokedCluster = GetCluster(connectionCredentials, cluster.Name, runspace);
98-
Assert.IsNotNull(accessRevokedCluster);
99-
Assert.IsTrue(string.IsNullOrEmpty(accessRevokedCluster.RdpUserName));
93+
Assert.NotNull(accessRevokedCluster);
94+
Assert.True(string.IsNullOrEmpty(accessRevokedCluster.RdpUserName));
10095
}
10196

10297
internal static AzureHDInsightCluster GetCluster(

src/ServiceManagement/HDInsight/Commands.HDInsight.Test/HDInsight/CommandTests/ManageAzureHDInsightRdpAccessCommandTests.cs

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
using System;
1616
using System.Collections.Generic;
1717
using System.Linq;
18-
using Microsoft.VisualStudio.TestTools.UnitTesting;
18+
using Microsoft.WindowsAzure.Commands.ScenarioTest;
19+
using Xunit;
1920
using Microsoft.WindowsAzure.Commands.Test.HDInsight.CmdLetTests;
2021
using Microsoft.WindowsAzure.Management.HDInsight;
2122
using Microsoft.WindowsAzure.Management.HDInsight.Cmdlet.Commands.CommandInterfaces;
@@ -26,47 +27,40 @@
2627

2728
namespace Microsoft.WindowsAzure.Commands.Test.HDInsight.CommandTests
2829
{
29-
[TestClass]
30-
public class ManageAzureHDInsightRdpAccessCommandTests : HDInsightTestCaseBase
30+
public class ManageAzureHDInsightRdpAccessCommandTests : HDInsightTestCaseBase, IDisposable
3131
{
32-
[TestCleanup]
33-
public override void TestCleanup()
32+
public void Dispose()
3433
{
3534
base.TestCleanup();
3635
}
3736

38-
[TestMethod]
39-
[TestCategory("Integration")]
40-
[TestCategory("CheckIn")]
41-
[TestCategory("Rdfe")]
37+
[Fact]
38+
[Trait(Category.AcceptanceType, Category.CheckIn)]
4239
public void CanGrantHDInsightRdpAccess()
4340
{
4441
var rdpUserName = "rdpuser";
4542
IHDInsightCertificateCredential creds = GetValidCredentials();
4643
AzureHDInsightCluster testCluster = GetClusterWithRdpAccessDisabled(creds);
4744
AzureHDInsightCluster cluster = EnableRdpAccessToCluster(
4845
creds, testCluster, rdpUserName, TestCredentials.AzurePassword, DateTime.UtcNow.AddDays(6));
49-
Assert.IsNotNull(cluster);
50-
Assert.AreEqual(cluster.RdpUserName, rdpUserName);
46+
Assert.NotNull(cluster);
47+
Assert.Equal(cluster.RdpUserName, rdpUserName);
5148
}
5249

53-
[TestMethod]
54-
[TestCategory("Integration")]
55-
[TestCategory("CheckIn")]
56-
[TestCategory("Rdfe")]
50+
[Fact]
51+
[Trait(Category.AcceptanceType, Category.CheckIn)]
5752
public void CanRevokeAccessToRdpServices()
5853
{
5954
IHDInsightCertificateCredential creds = GetValidCredentials();
6055
AzureHDInsightCluster testCluster = GetClusterWithRdpAccessDisabled(creds);
6156
EnableRdpAccessToCluster(creds, testCluster, TestCredentials.AzureUserName, TestCredentials.AzurePassword,
6257
DateTime.UtcNow.AddDays(6));
6358
AzureHDInsightCluster cluster = DisableRdpAccessToCluster(creds, testCluster);
64-
Assert.IsNotNull(cluster);
65-
Assert.IsTrue(string.IsNullOrEmpty(cluster.RdpUserName));
59+
Assert.NotNull(cluster);
60+
Assert.True(string.IsNullOrEmpty(cluster.RdpUserName));
6661
}
6762

68-
[TestInitialize]
69-
public override void Initialize()
63+
public ManageAzureHDInsightRdpAccessCommandTests()
7064
{
7165
base.Initialize();
7266
}

src/ServiceManagement/HDInsight/Commands.HDInsight.Test/packages.config

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,10 @@
2222
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
2323
<package id="System.Spatial" version="5.6.0" targetFramework="net45" />
2424
<package id="WindowsAzure.Storage" version="3.0.3.0" targetFramework="net45" />
25-
<package id="xunit.runner.visualstudio" version="2.0.0" targetFramework="net45" />
25+
<package id="xunit" version="2.1.0-beta1-build2945" targetFramework="net45" />
26+
<package id="xunit.abstractions" version="2.0.0" targetFramework="net45" />
27+
<package id="xunit.assert" version="2.1.0-beta1-build2945" targetFramework="net45" />
28+
<package id="xunit.core" version="2.1.0-beta1-build2945" targetFramework="net45" />
29+
<package id="xunit.extensibility.core" version="2.1.0-beta1-build2945" targetFramework="net45" />
30+
<package id="xunit.runner.visualstudio" version="2.1.0-beta1-build1051" targetFramework="net45" />
2631
</packages>

0 commit comments

Comments
 (0)