public async Task MapListAsync_ToNewObject_MappedAsync() { var mapper = new AsyncMapper(); var to = await mapper .MapListAsync( new MapFrom[] { new MapFrom() { Property = 1 }, new MapFrom() { Property = 2 }, }, this.cancellationTokenSource.Token) .ConfigureAwait(false); Assert.Equal(this.cancellationTokenSource.Token, mapper.CancellationToken); Assert.IsType <List <MapTo> >(to); Assert.Equal(2, to.Count); Assert.Equal(1, to[0].Property); Assert.Equal(2, to[1].Property); }
public async Task MapListAsync_Empty_MappedAsync() { var mapper = new AsyncMapper(); var to = await mapper.MapListAsync(Array.Empty <MapFrom>()).ConfigureAwait(false); Assert.IsType <List <MapTo> >(to); Assert.Empty(to); }
public async Task MapListAsync_Empty_Mapped() { var mapper = new AsyncMapper(); var to = await mapper.MapListAsync( new MapFrom[0]); Assert.IsType <List <MapTo> >(to); Assert.Empty(to); }
public async Task MapListAsync_Empty_MappedAsync() { var mapper = new AsyncMapper(); var to = await mapper .MapListAsync(Array.Empty <MapFrom>(), this.cancellationTokenSource.Token) .ConfigureAwait(false); Assert.IsType <List <MapTo> >(to); Assert.Empty(to); }
public async Task MapListAsync_ToNewObject_Mapped() { var mapper = new AsyncMapper(); var to = await mapper.MapListAsync( new MapFrom[] { new MapFrom() { Property = 1 }, new MapFrom() { Property = 2 } }); Assert.IsType <List <MapTo> >(to); Assert.Equal(2, to.Count); Assert.Equal(1, to[0].Property); Assert.Equal(2, to[1].Property); }