Beispiel #1
0
        private async Task CreateAsset(string developer)
        {
            var entity = TestData.Domain.GenerateAsset();

            entity.DevelopingRslName = developer;
            await _gateway.CreateAsync(entity).ConfigureAwait(false);
        }
        public async Task GivenAnAssetHasBeenCreated_WhenTheAssetIsReadFromTheGateway_ThenItIsTheSame()
        {
            //arrange
            using (var trans = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
            {
                var entity       = TestData.Domain.GenerateAsset();
                var createdAsset = await _classUnderTest.CreateAsync(entity).ConfigureAwait(false);

                //act
                var readAsset = await _classUnderTest.ReadAsync(createdAsset.Id).ConfigureAwait(false);

                //assert
                readAsset.AssetIsEqual(createdAsset.Id, entity);
                trans.Dispose();
            }
        }
        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();
            }
        }