forked from Azure/azure-powershell
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New-AzureVm SimpleParameterSet, Strategies
- Loading branch information
1 parent
339519b
commit db1f851
Showing
81 changed files
with
3,583 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -211,4 +211,5 @@ FakesAssemblies/ | |
/tools/*.dll | ||
*.GhostDoc.xml | ||
pingme.txt | ||
groupMapping*.json | ||
groupMapping*.json | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
89 changes: 89 additions & 0 deletions
89
...ger/Common/Commands.Common.Strategies.UnitTest/Commands.Common.Strategies.UnitTest.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{5C052681-DA3C-4FEA-8E02-7DFBB2A18B22}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>Microsoft.Azure.Commands.Common.Strategies.UnitTest</RootNamespace> | ||
<AssemblyName>Microsoft.Azure.Commands.Common.Strategies.UnitTest</AssemblyName> | ||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> | ||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> | ||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> | ||
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath> | ||
<IsCodedUITest>False</IsCodedUITest> | ||
<TestProjectType>UnitTest</TestProjectType> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
</ItemGroup> | ||
<Choose> | ||
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'"> | ||
<ItemGroup> | ||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> | ||
</ItemGroup> | ||
</When> | ||
<Otherwise> | ||
<ItemGroup> | ||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" /> | ||
</ItemGroup> | ||
</Otherwise> | ||
</Choose> | ||
<ItemGroup> | ||
<Compile Include="TimeSlotTest.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\Commands.Common.Strategies\Commands.Common.Strategies.csproj"> | ||
<Project>{eea69772-d41b-482a-9252-2b4595c59e53}</Project> | ||
<Name>Commands.Common.Strategies</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<Choose> | ||
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'"> | ||
<ItemGroup> | ||
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> | ||
<Private>False</Private> | ||
</Reference> | ||
</ItemGroup> | ||
</When> | ||
</Choose> | ||
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" /> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
36 changes: 36 additions & 0 deletions
36
src/ResourceManager/Common/Commands.Common.Strategies.UnitTest/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("Commands.Common.Strategies.UnitTest")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("Commands.Common.Strategies.UnitTest")] | ||
[assembly: AssemblyCopyright("Copyright © 2017")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[assembly: Guid("5c052681-da3c-4fea-8e02-7dfbb2a18b22")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Build and Revision Numbers | ||
// by using the '*' as shown below: | ||
// [assembly: AssemblyVersion("1.0.*")] | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
72 changes: 72 additions & 0 deletions
72
src/ResourceManager/Common/Commands.Common.Strategies.UnitTest/TimeSlotTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace Microsoft.Azure.Commands.Common.Strategies.UnitTest | ||
{ | ||
[TestClass] | ||
public class TimeSlotTest | ||
{ | ||
[TestMethod] | ||
public void AddTest() | ||
{ | ||
var first = new TimeSlot(); | ||
|
||
Assert.AreEqual(0, first.Duration); | ||
Assert.AreEqual(0, first.TaskCount); | ||
Assert.AreEqual(null, first.Next); | ||
|
||
var next = first.AddTask(50); | ||
|
||
Assert.AreEqual(50, first.Duration); | ||
Assert.AreEqual(1, first.TaskCount); | ||
Assert.AreEqual(next, first.Next); | ||
|
||
Assert.AreEqual(10.0, first.GetTaskProgress(10)); | ||
|
||
Assert.AreEqual(0, next.Duration); | ||
Assert.AreEqual(0, next.TaskCount); | ||
Assert.AreEqual(null, next.Next); | ||
|
||
var next2 = first.AddTask(50); | ||
|
||
Assert.AreEqual(50, first.Duration); | ||
Assert.AreEqual(2, first.TaskCount); | ||
Assert.AreEqual(next2, first.Next); | ||
Assert.AreEqual(next, first.Next); | ||
|
||
Assert.AreEqual(20.0, first.GetTaskProgress(40)); | ||
|
||
Assert.AreEqual(0, next2.Duration); | ||
Assert.AreEqual(0, next2.TaskCount); | ||
Assert.AreEqual(null, next2.Next); | ||
|
||
var next3 = first.AddTask(30); | ||
Assert.AreEqual(30, first.Duration); | ||
Assert.AreEqual(3, first.TaskCount); | ||
Assert.AreEqual(next3, first.Next); | ||
|
||
Assert.AreEqual(3.0, first.GetTaskProgress(9)); | ||
|
||
Assert.AreEqual(20, next3.Duration); | ||
Assert.AreEqual(2, next3.TaskCount); | ||
Assert.AreEqual(next2, next3.Next); | ||
Assert.AreEqual(next, next3.Next); | ||
|
||
Assert.AreEqual(10.0 + 5, first.GetTaskProgress(40)); | ||
|
||
Assert.AreEqual(0, next2.Duration); | ||
Assert.AreEqual(0, next2.TaskCount); | ||
Assert.AreEqual(null, next2.Next); | ||
|
||
var next4 = first.AddTask(75); | ||
Assert.AreEqual(25, next2.Duration); | ||
Assert.AreEqual(1, next2.TaskCount); | ||
Assert.AreEqual(next4, next2.Next); | ||
|
||
Assert.AreEqual((30.0 / 4) + (20.0 / 3) + 20, first.GetTaskProgress(70)); | ||
|
||
Assert.AreEqual(0, next4.Duration); | ||
Assert.AreEqual(0, next4.TaskCount); | ||
Assert.AreEqual(null, next4.Next); | ||
} | ||
} | ||
} |
104 changes: 104 additions & 0 deletions
104
src/ResourceManager/Common/Commands.Common.Strategies/Commands.Common.Strategies.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{EEA69772-D41B-482A-9252-2B4595C59E53}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>Microsoft.Azure.Commands.Common.Strategies</RootNamespace> | ||
<AssemblyName>Microsoft.Azure.Commands.Common.Strategies</AssemblyName> | ||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>..\..\..\Package\Debug\ResourceManager\AzureResourceManager\AzureRM.Compute\</OutputPath> | ||
<DefineConstants>TRACE;DEBUG</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE;SIGN</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<SignAssembly>true</SignAssembly> | ||
<DelaySign>true</DelaySign> | ||
<AssemblyOriginatorKeyFile>MSSharedLibKey.snk</AssemblyOriginatorKeyFile> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.2.3.10\lib\net452\Microsoft.Rest.ClientRuntime.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
<HintPath>..\..\..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.10\lib\net452\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> | ||
<HintPath>..\..\..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Net.Http" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="IReportProgress.cs" /> | ||
<Compile Include="IResourceConfig.cs" /> | ||
<Compile Include="IResourceConfigVisitor.cs" /> | ||
<Compile Include="IResourceStrategy.cs" /> | ||
<Compile Include="IShouldProcess.cs" /> | ||
<Compile Include="ProgressMap.cs" /> | ||
<Compile Include="TimeSlot.cs" /> | ||
<Compile Include="StateOperationContext.cs" /> | ||
<Compile Include="SyncTaskScheduler.cs" /> | ||
<Compile Include="TimeSlotExtensions.cs" /> | ||
<Compile Include="UpdateStateExtensions.cs" /> | ||
<Compile Include="CreateOrUpdateAsyncParams.cs" /> | ||
<Compile Include="EntityConfigExtensions.cs" /> | ||
<Compile Include="Extensions.cs" /> | ||
<Compile Include="GetStateExtensions.cs" /> | ||
<Compile Include="GetAsyncParams.cs" /> | ||
<Compile Include="IClient.cs" /> | ||
<Compile Include="IEntityConfig.cs" /> | ||
<Compile Include="IEntityConfigVisitor.cs" /> | ||
<Compile Include="IEntityStrategy.cs" /> | ||
<Compile Include="IState.cs" /> | ||
<Compile Include="NestedResourceConfigExtensions.cs" /> | ||
<Compile Include="ResourceConfigExtensions.cs" /> | ||
<Compile Include="StateExtensions.cs" /> | ||
<Compile Include="NestedResourceConfig.cs" /> | ||
<Compile Include="NestedResourceStrategy.cs" /> | ||
<Compile Include="TargetStateExtensions.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="ResourceConfig.cs" /> | ||
<Compile Include="ResourceStrategy.cs" /> | ||
<Compile Include="State.cs" /> | ||
<Compile Include="LocationExtensions.cs" /> | ||
<Compile Include="Void.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="MSSharedLibKey.snk" /> | ||
<None Include="packages.config" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
Oops, something went wrong.