Skip to content

Commit

Permalink
test fixes and PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
TimPurdum committed Mar 23, 2024
1 parent a781d2c commit 1b8985a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ public class BasemapLayerListWidget : Widget
/// <returns>
/// Returns the modified base <see cref="ListItem" />
/// </returns>
/// <remarks>
/// For internal use only. This returns an object simply for JavaScript serialization purposes.
/// </remarks>
[JSInvokable]
public async Task<object> OnBaseListItemCreated(ListItem item)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@

var firstGraphic = graphicHit[0];

Assert.IsNotNull(firstGraphic.Layer);
Assert.IsNotNull(firstGraphic.LayerId);
Assert.IsNotNull(firstGraphic.MapPoint);
Assert.IsNotNull(firstGraphic.Graphic);


Assert.AreEqual<Guid>(graphic.Id, firstGraphic.Graphic.Id);
Assert.AreEqual(graphic.Id, firstGraphic.Graphic.Id);
}

[TestMethod]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,26 @@
Assert.AreNotEqual(extent, newExtent);
}

[TestMethod]
public async Task TestCanHitViewReturnCountryPolygon(Action renderHandler)
{
MapView? view = null;
FeatureLayer? countriesLayer = null;
AddMapRenderFragment(
@<MapView @ref="view" class="map-view" OnViewRendered="renderHandler">
<Map>
<FeatureLayer @ref="countriesLayer" Title="Countries">
<PortalItem Id="ac80670eb213440ea5899bbf92a04998"/>
</FeatureLayer>
</Map>
</MapView>);
await WaitForMapToRender();

Point mapPoint = new Point(-74.0059, 40.7127);
await view!.AddGraphic(new Graphic(mapPoint, new SimpleMarkerSymbol(color: new MapColor("green"))));
ScreenPoint screenPoint = await view!.ToScreen(mapPoint);
HitTestResult result = await view!.HitTest(screenPoint);
Assert.IsNotNull(result);
}

}

0 comments on commit 1b8985a

Please sign in to comment.