예제 #1
0
        public async Task ConcatWithInt32SourceWithFirstWithSecondIsEquivalentToConcatTest()
        {
            // Arrange

            // Arrange 'queryAdapter' parameter
            var queryAdapter = await GetQueryAdapterAsync(DisallowAll);

            // Arrange 'first' parameter
            var first = GetQueryable <int>();

            // Arrange 'second' parameter
            var second = GetQueryable <int>();

            // Arrange 'asyncFirst' parameter
            var asyncFirst = queryAdapter.GetAsyncQueryable <int>();

            // Arrange 'asyncSecond' parameter
            var asyncSecond = queryAdapter.GetAsyncQueryable <int>();

            // Arrange 'expectedResult' parameter
            var expectedResult = Enumerable.Concat <int>(first, second);

            // Act
            var result = await AsyncQueryable.Concat <int>(asyncFirst, asyncSecond).ToListAsync().ConfigureAwait(false);

            // Assert
            Assert.Equal(expectedResult, result);
        }
예제 #2
0
        public async Task ConcatWithDoubleSourceWithFirstWithSecondNullSecondThrowsArgumentNullExceptionTest()
        {
            // Arrange

            // Arrange 'queryAdapter' parameter
            var queryAdapter = await GetQueryAdapterAsync(DisallowAll);

            // Arrange 'asyncFirst' parameter
            var asyncFirst = queryAdapter.GetAsyncQueryable <double>();

            // Arrange 'asyncSecond' parameter
            IAsyncEnumerable <double> asyncSecond = null !;

            // Act
            // -

            // Assert
            await Assert.ThrowsAsync <ArgumentNullException>(async() =>
            {
                await AsyncQueryable.Concat <double>(asyncFirst, asyncSecond).ToListAsync().ConfigureAwait(false);
            });
        }