public async Task <GetAssetRegionsResponse> ExecuteAsync(CancellationToken cancellationToken) { var regions = await _assetRegionLister.ListRegionsAsync(cancellationToken).ConfigureAwait(false); var response = new GetAssetRegionsResponse { Regions = regions }; return(response); }
public async Task GivenAnAssetHasBeenCreated_WhenTheAssetIsReadFromTheGateway_ThenItIsTheSame(string region) { //arrange using (var trans = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled)) { var entity = TestData.Domain.GenerateAsset(); entity.ImsOldRegion = region; entity.LocationLaRegionName = region; var createdAsset = await _gateway.CreateAsync(entity).ConfigureAwait(false); //act var regions = await _classUnderTest.ListRegionsAsync(CancellationToken.None).ConfigureAwait(false); //assert regions.Count.Should().Be(1); trans.Dispose(); } }