public async Task Test1() { var couple = new OriginDestination(AmsIata, BudIata); var service = new DistanceMeasurementService(this.placeInfoProviderMock.Object); this.SetupPlaceInfoProviderGetPlaceInfoAsyncMethod(AmsIata, new IataPoint(AmsIata, new Location(AmsLatitude, AmsLongitude))); this.SetupPlaceInfoProviderGetPlaceInfoAsyncMethod(BudIata, new IataPoint(BudIata, new Location(BudLatitude, BudLongitude))); var serviceResponse = await service.GetDistanceAsync(couple, CancellationToken.None); serviceResponse.IsFailure.Should().BeFalse(); serviceResponse.Value.Should().Be(AsmBudDistance); }
public async Task Test2() { var incorrectIata = this.fixture.Create <string>(); var couple = new OriginDestination(AmsIata, incorrectIata); var service = new DistanceMeasurementService(this.placeInfoProviderMock.Object); this.SetupPlaceInfoProviderGetPlaceInfoAsyncMethod(AmsIata, new IataPoint(AmsIata, new Location(AmsLatitude, AmsLongitude))); this.SetupPlaceInfoProviderGetPlaceInfoAsyncMethod(incorrectIata, Result.Failure <IataPoint>(this.fixture.Create <string>())); var serviceResponse = await service.GetDistanceAsync(couple, CancellationToken.None); serviceResponse.IsFailure.Should().BeTrue(); }