Exemple #1
0
        public async Task Then_Calls_Location_Service_To_Get_GeoPoint(
            GetGeoPointQuery query,
            GetGeoPointResponse apiResponse,
            [Frozen] Mock <ILocationLookupService> mockLocationLookupService,
            GetGeoPointQueryHandler handler)
        {
            var result = await handler.Handle(query, CancellationToken.None);

            mockLocationLookupService.Verify(p => p.GetLocationInformation(query.Postcode, default(double), default(double), false), Times.Once);
        }
Exemple #2
0
        public async Task When_Location_Is_Not_Found_Then_Return_Empty_Geopoint(
            GetGeoPointQuery query,
            GetGeoPointResponse apiResponse,
            [Frozen] Mock <ILocationLookupService> mockLocationLookupService,
            GetGeoPointQueryHandler handler)
        {
            mockLocationLookupService.Setup(m => m.GetLocationInformation(query.Postcode, default(double), default(double), false)).ReturnsAsync((LocationItem)null);

            var result = await handler.Handle(query, CancellationToken.None);

            result.GetPointResponse.Should().BeNull();
        }