Exemplo n.º 1
0
        public IEnumerable <TSource> TakeLastTest <TSource>(IEnumerable <TSource> source, int count)
        {
            IEnumerable <TSource> result = EnumerableExtension.TakeLast <TSource>(source, count);

            return(result);
            // TODO: add assertions to method EnumerableExtensionTest.TakeLastTest(IEnumerable`1<!!0>, Int32)
        }
Exemplo n.º 2
0
        public async Task TakeLastWithNullableDecimalSourceWithCountIsEquivalentToTakeLastTest()
        {
            // Arrange

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

            // Arrange 'source' parameter
            var source = GetQueryable <decimal?>();

            // Arrange 'asyncSource' parameter
            var asyncSource = queryAdapter.GetAsyncQueryable <decimal?>();

            // Arrange 'count' parameter
            var count = 5;

            // Arrange 'expectedResult' parameter
            var expectedResult =
                EnumerableExtension
                .TakeLast <decimal?>(source, count);

            // Act
            var result = await AsyncQueryable.TakeLast <decimal?>(asyncSource, count).ToListAsync().ConfigureAwait(false);

            // Assert
            Assert.Equal(expectedResult, result);
        }