File tree Expand file tree Collapse file tree 3 files changed +65
-0
lines changed
src/ResourceManager/Compute/Commands.Compute.Test Expand file tree Collapse file tree 3 files changed +65
-0
lines changed Original file line number Diff line number Diff line change 195
195
<DependentUpon >Resources.resx</DependentUpon >
196
196
</Compile >
197
197
<Compile Include =" Properties\AssemblyInfo.cs" />
198
+ <Compile Include =" ScenarioTests\StrategiesVirtualMachineTests.cs" />
198
199
</ItemGroup >
199
200
<ItemGroup >
200
201
<ProjectReference Include =" ..\..\..\Common\Commands.Common.Authentication.Abstractions\Commands.Common.Authentication.Abstractions.csproj" >
358
359
<None Include =" SessionRecords\**\*.json" >
359
360
<CopyToOutputDirectory >Always</CopyToOutputDirectory >
360
361
</None >
362
+ <None Include =" ScenarioTests\StrategiesVirtualMachineTests.ps1" >
363
+ <CopyToOutputDirectory >Always</CopyToOutputDirectory >
364
+ </None >
361
365
<None Include =" Templates\azuredeploy.json" >
362
366
<CopyToOutputDirectory >Always</CopyToOutputDirectory >
363
367
</None >
Original file line number Diff line number Diff line change
1
+ using Microsoft . Azure . Commands . Compute . Test . ScenarioTests ;
2
+ using Microsoft . WindowsAzure . Commands . ScenarioTest ;
3
+ using Xunit ;
4
+
5
+ namespace Microsoft . Azure . Commands . Compute . Test . ScenarioTests
6
+ {
7
+ public class StrategiesVirtualMachineTests
8
+ {
9
+ public StrategiesVirtualMachineTests ( Xunit . Abstractions . ITestOutputHelper output )
10
+ {
11
+ ServiceManagemenet . Common . Models . XunitTracingInterceptor . AddToContext ( new ServiceManagemenet . Common . Models . XunitTracingInterceptor ( output ) ) ;
12
+ }
13
+
14
+ [ Fact ( /*Skip = "TODO: only works for live mode"*/ ) ]
15
+ [ Trait ( Category . RunType , Category . LiveOnly ) ]
16
+ public void TestSimpleNewVm ( )
17
+ {
18
+ ComputeTestController . NewInstance . RunPsTest ( "Test-SimpleNewVm" ) ;
19
+ }
20
+ }
21
+ }
Original file line number Diff line number Diff line change
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
+ <#
16
+ . SYNOPSIS
17
+ Test Simple Paremeter Set for New Vm
18
+ #>
19
+ function Test-SimpleNewVm
20
+ {
21
+ # Setup
22
+ $vmname = Get-ResourceName
23
+
24
+ try
25
+ {
26
+ $username = " domain01\admin01"
27
+ $password = " Qwe123Asd456Zxc890!" | ConvertTo-SecureString
28
+ $cred = new-object - typename System.Management.Automation.PSCredential - argumentlist $username , $password
29
+
30
+ # Common
31
+ $x = New-AzureRmVM - Name $vmname - Credential $cred
32
+
33
+ Assert-AreEqual $vmname $x.Name ;
34
+ }
35
+ finally
36
+ {
37
+ # Cleanup
38
+ Clean - ResourceGroup $vmname
39
+ }
40
+ }
You can’t perform that action at this time.
0 commit comments