Remove System.Array type data (#3231)

* Rename Types_Ps1Xml.generated.cs
* Remove <auto-generated> header from Types_Ps1Xml.cs
* Remove System.Array type data
* Update `Get-TypeData` tests
This commit is contained in:
PetSerAl 2017-03-01 23:58:03 +03:00 committed by Dongbo Wang
parent fc30ae1d87
commit c490e36a58
4 changed files with 9 additions and 22 deletions

View File

@ -1,11 +1,3 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System.Collections.Generic;
using System.Management.Automation;
using System.Reflection;
@ -31,11 +23,6 @@ namespace System.Management.Automation.Runspaces
{
TypeData td;
var td1 = new TypeData(@"System.Array", true);
td1.Members.Add("Count",
new AliasPropertyData("Count", "Length"));
yield return td1;
var td2 = new TypeData(@"System.Xml.XmlNode", true);
td2.Members.Add("ToString",
new CodeMethodData("ToString", GetMethodInfo(typeof(Microsoft.PowerShell.ToStringCodeMethods), @"XmlNode")));

View File

@ -230,7 +230,7 @@
"monad/src/engine/ComInterop/IDispatchComObject.cs": "engine/ComInterop/IDispatchComObject.cs",
"monad/src/engine/remoting/commands/ConnectPSSession.cs": "engine/remoting/commands/ConnectPSSession.cs",
"monad/src/engine/resources/Logging.resx": "resources/Logging.resx",
"monad/src/engine/Types_Ps1Xml.generated.cs": "engine/Types_Ps1Xml.generated.cs",
"monad/src/engine/Types_Ps1Xml.cs": "engine/Types_Ps1Xml.cs",
"monad/src/engine/remoting/common/WireDataFormat/EncodeAndDecode.cs": "engine/remoting/common/WireDataFormat/EncodeAndDecode.cs",
"monad/src/commands/utility/FormatAndOutput/out-console/OutConsole.cs": "commands/utility/FormatAndOutput/out-console/OutConsole.cs",
"monad/src/engine/debugger/debugger.cs": "engine/debugger/debugger.cs",

View File

@ -1582,8 +1582,8 @@
<Compile Include="..\System.Management.Automation\engine\TypesV3_Ps1Xml.generated.cs">
<Link>engine\TypesV3_Ps1Xml.generated.cs</Link>
</Compile>
<Compile Include="..\System.Management.Automation\engine\Types_Ps1Xml.generated.cs">
<Link>engine\Types_Ps1Xml.generated.cs</Link>
<Compile Include="..\System.Management.Automation\engine\Types_Ps1Xml.cs">
<Link>engine\Types_Ps1Xml.cs</Link>
</Compile>
<Compile Include="..\System.Management.Automation\engine\TypeTable.cs">
<Link>engine\TypeTable.cs</Link>

View File

@ -1,19 +1,19 @@
Describe "TestData cmdlets" -Tags "CI" {
Context "Get-TypeData" {
It "System.Array" {
(Get-TypeData System.Array).TypeName | Should Be System.Array
It "System.DateTime" {
(Get-TypeData System.DateTime).TypeName | Should Be System.DateTime
# Supports pipelining?
("System.Array" | Get-TypeData).TypeName | Should Be System.Array
("System.DateTime" | Get-TypeData).TypeName | Should Be System.DateTime
}
It "Type accelerators" {
(Get-TypeData Array).TypeName | Should Be System.Array
(Get-TypeData DateTime).TypeName | Should Be System.DateTime
(Get-TypeData psCredential).TypeName | Should Be System.Management.Automation.PSCredential
}
It "Accept multiple types" {
$types = Get-TypeData System.Array, System.Management.Automation* | Sort-Object -Property TypeName
$types[0].TypeName | Should Be System.Array
$types = Get-TypeData System.DateTime, System.Management.Automation* | Sort-Object -Property TypeName
$types[0].TypeName | Should Be System.DateTime
for($i = 1; $i -lt $types.Count; $i++)
{
$types[$i].TypeName.StartsWith("System.Management.Automation") | Should Be $true