Example #1
0
        public Task MapAsync_Null_ThrowsArgumentNullExceptionAsync()
        {
            var mapper = new AsyncMapper();

            return(Assert.ThrowsAsync <ArgumentNullException>(
                       "source",
                       () => mapper.MapAsync(null, this.cancellationTokenSource.Token)));
        }
Example #2
0
        public async Task MapAsync_ToNewObject_Mapped()
        {
            var mapper = new AsyncMapper();

            var to = await mapper.MapAsync(new MapFrom()
            {
                Property = 1
            });

            Assert.Equal(1, to.Property);
        }
Example #3
0
        public async Task MapAsync_ToNewObject_MappedAsync()
        {
            var mapper = new AsyncMapper();

            var to = await mapper
                     .MapAsync(new MapFrom()
            {
                Property = 1
            }, this.cancellationTokenSource.Token)
                     .ConfigureAwait(false);

            Assert.Equal(this.cancellationTokenSource.Token, mapper.CancellationToken);
            Assert.Equal(1, to.Property);
        }
Example #4
0
        public Task MapAsync_Null_ThrowsArgumentNullException()
        {
            var mapper = new AsyncMapper();

            return(Assert.ThrowsAsync <ArgumentNullException>("source", () => mapper.MapAsync(null)));
        }