Skip to content

[FEATURE REQ]Unable to unit tests GeocodingResponse and sub classes #50057

@FranckSix

Description

@FranckSix

Library name

Azure.Maps.Search

Please describe the feature.

I everybody,

I use Moq for unit tests and I try to mock MapsSearchClient.GetGeocodingAsync. But I am unable to fake the GeocodingResponse class all of its constructors ar internal and no interface on the class. The same problem for subclasses of GeocodingResponse.

On assembly Azure.Maps.Search.Models:

  • Azure.Maps.Search.Models.FeaturesItem
  • Azure.Maps.Search.Models.FeaturesItemProperties
  • Azure.Maps.Search.Models.Address
  • Intersection
  • AddressAdminDistrictsItem
  • AddressCountryRegion
  • GeocodePointsItem

I see the MapsSearchModelFactory , may help but missing the FeaturesItem generator.

I can't apply the recommendations from the documentation Mocking

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientThis issue is related to a non-management packageMapsService AttentionWorkflow: This issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions