public async Task MapArrayAsync_ToNewObject_MappedAsync() { var mapper = new AsyncMapper(); var to = await mapper .MapArrayAsync( new MapFrom[] { new MapFrom() { Property = 1 }, new MapFrom() { Property = 2 }, }, this.cancellationTokenSource.Token) .ConfigureAwait(false); Assert.Equal(this.cancellationTokenSource.Token, mapper.CancellationToken); Assert.IsType <MapTo[]>(to); Assert.Equal(2, to.Length); Assert.Equal(1, to[0].Property); Assert.Equal(2, to[1].Property); }
public async Task MapArrayAsync_Empty_MappedAsync() { var mapper = new AsyncMapper(); var to = await mapper.MapArrayAsync(Array.Empty <MapFrom>()).ConfigureAwait(false); Assert.IsType <MapTo[]>(to); Assert.Empty(to); }
public async Task MapArrayAsync_Empty_Mapped() { var mapper = new AsyncMapper(); var to = await mapper.MapArrayAsync( new MapFrom[0]); Assert.IsType <MapTo[]>(to); Assert.Empty(to); }
public async Task MapArrayAsync_Empty_MappedAsync() { var mapper = new AsyncMapper(); var to = await mapper .MapArrayAsync(Array.Empty <MapFrom>(), this.cancellationTokenSource.Token) .ConfigureAwait(false); Assert.IsType <MapTo[]>(to); Assert.Empty(to); }
public async Task MapArrayAsync_ToNewObject_Mapped() { var mapper = new AsyncMapper(); var to = await mapper.MapArrayAsync( new MapFrom[] { new MapFrom() { Property = 1 }, new MapFrom() { Property = 2 } }); Assert.IsType <MapTo[]>(to); Assert.Equal(2, to.Length); Assert.Equal(1, to[0].Property); Assert.Equal(2, to[1].Property); }