File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
PSCompatibilityAnalyzer/Tests Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ # Copyright (c) Microsoft Corporation. All rights reserved.
2+ # Licensed under the MIT License.
3+
4+ Describe " .NET type with members with names differing only by name" {
5+ BeforeAll {
6+ Add-Type - TypeDefinition @'
7+ namespace PSScriptAnalyzerTests
8+ {
9+ public class QueryApiTestObject
10+ {
11+ public string JobId { get; set; }
12+
13+ public object JOBID { get; set; }
14+ }
15+ }
16+ '@
17+ }
18+
19+ It " Does not crash the query API" {
20+ $typeData = [Microsoft.PowerShell.CrossCompatibility.Utility.TypeDataConversion ]::AssembleType([PSScriptAnalyzerTests.QueryApiTestObject ])
21+
22+ $typeQueryObject = New-Object ' Microsoft.PowerShell.CrossCompatibility.Query.TypeData' (' QueryApiTestObject' , $typeData )
23+
24+ $typeData.Instance.Properties.Count | Should - Be 1
25+ $typeData.Instance.Properties.Keys | Should - Contain ' jobid'
26+ }
27+ }
You can’t perform that action at this time.
0 commit comments