Skip to content

Commit

Permalink
Fixing read only dictionary lookup. (#536)
Browse files Browse the repository at this point in the history
* Fixing read only dictionary lookup.

* Lower timeout.

Co-authored-by: Scott Jones <[email protected]>
  • Loading branch information
manodasanW and Scottj1s authored Nov 3, 2020
1 parent 684f321 commit 25e2ed4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
26 changes: 22 additions & 4 deletions UnitTest/TestComponentCSharp_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,26 @@ public void TestVectorCastConversion()
var uriVector = vector.Cast<Uri>();
var first = uriVector.First();
Assert.Equal(vector, uriVector);
}

}

async Task LookupPorts()
{
var ports = await Windows.Devices.Enumeration.DeviceInformation.FindAllAsync(
Windows.Devices.SerialCommunication.SerialDevice.GetDeviceSelector(),
new string[] { "System.ItemNameDisplay" });
foreach (var port in ports)
{
object o = port.Properties["System.ItemNameDisplay"];
Assert.NotNull(o);
}
}

[Fact]
public void TestReadOnlyDictionaryLookup()
{
Assert.True(LookupPorts().Wait(1000));
}

#if NET5_0
[Fact]
public void TestAsStream()
Expand Down Expand Up @@ -353,8 +371,8 @@ public void TestBuffer()
Assert.True(arr1[1] == arr2[1]);
}

#endif

#endif

async Task TestStorageFileAsync()
{
var folderPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
Expand Down
2 changes: 1 addition & 1 deletion WinRT.Runtime/Projections/IReadOnlyDictionary.net5.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class FromAbiHelper : global::System.Collections.Generic.IReadOnlyDiction
public FromAbiHelper(global::Windows.Foundation.Collections.IMapView<K, V> mapView, ObjectReference<Vftbl> objRef)
{
_mapView = mapView;
_enumerable = (System.Collections.Generic.IEnumerable<global::System.Collections.Generic.KeyValuePair<K, V>>)new IInspectable(objRef);
_enumerable = (global::System.Collections.Generic.IEnumerable<global::System.Collections.Generic.KeyValuePair<K, V>>)new IInspectable(objRef);
}

public int Count
Expand Down

0 comments on commit 25e2ed4

Please sign in to comment.