Example #1
0
 public IAsyncEnumerable <string> GetDataAsync()
 {
     SimpleFile.ReadAsync();
     return(AsyncEnumerable.Empty <string>());
 }
Example #2
0
 public ValueTask <int> Linq_AsyncEnumerable_Reference()
 => AsyncEnumerable.CountAsync(asyncEnumerableReference);
 public ValueTask <int[]> Linq_Async()
 => AsyncEnumerable.Range(0, Count).ToArrayAsync();
        => Task.FromResult <IUser>(null);    //Overriden

        IAsyncEnumerable <IReadOnlyCollection <IUser> > IChannel.GetUsersAsync(CacheMode mode, RequestOptions options)
        => AsyncEnumerable.Empty <IReadOnlyCollection <IUser> >();  //Overriden
 public async void Error_Other()
 {
     await AsyncEnumerable.Timer(TimeSpan.FromMilliseconds(200))
     .SkipUntil(AsyncEnumerable.Error <int>(new InvalidOperationException()))
     .AssertFailure(typeof(InvalidOperationException));
 }
Example #6
0
        public async Task SelectAsync_Empty()
        {
            var enumerable = AsyncEnumerable.EmptyAsync <int>();

            Assert.AreEqual(0, await enumerable.SelectAsync(i => (double)i).CountAsync());
        }
Example #7
0
 public IAsyncEnumerable <string> GetLegacyDocumentDeletionsAsync()
 {
     return(AsyncEnumerable.Empty <string>());
 }
 public async void Empty()
 {
     await AsyncEnumerable.CombineLatest <int, int>(v => v.Sum())
     .AssertResult();
 }
 public async void Single()
 {
     await AsyncEnumerable.CombineLatest(v => v.Sum() + 1,
                                         AsyncEnumerable.Just(1))
     .AssertResult(2);
 }
Example #10
0
 public async void SourceSupplier_Crash()
 {
     await AsyncEnumerable.Using <int, int>(() => 1,
                                            v => throw new InvalidOperationException(), v => { })
     .AssertFailure(typeof(InvalidOperationException));
 }
Example #11
0
 public async void SourceSupplier_And_Cleanup_Crash()
 {
     await AsyncEnumerable.Using <int, int>(() => 1,
                                            v => throw new InvalidOperationException(), v => throw new IndexOutOfRangeException())
     .AssertFailure(typeof(AggregateException));
 }
Example #12
0
 public async void None()
 {
     await AsyncEnumerable.Range(1, 5)
     .TakeLast(0)
     .AssertResult();
 }
Example #13
0
 public async void Some()
 {
     await AsyncEnumerable.Range(1, 5)
     .TakeLast(2)
     .AssertResult(4, 5);
 }
Example #14
0
 public async void All()
 {
     await AsyncEnumerable.Range(1, 5)
     .TakeLast(5)
     .AssertResult(1, 2, 3, 4, 5);
 }
Example #15
0
        public async Task WhereAsync_Empty()
        {
            var enumerable = AsyncEnumerable.EmptyAsync <int>();

            Assert.AreEqual(0, await enumerable.WhereAsync(i => i > 0).CountAsync());
        }
 public async void One_Item_Each()
 {
     await AsyncEnumerable.CombineLatest(v => v.Sum(), AsyncEnumerable.Just(1), AsyncEnumerable.Just(2))
     .AssertResult(3);
 }
Example #17
0
        public async Task CountAsync_Filter_Empty_ReturnsZero()
        {
            var enumerable = AsyncEnumerable.EmptyAsync <int>();

            Assert.AreEqual(0, await enumerable.CountAsync(i => i > 0));
        }
 public async void Two_Is_Empty()
 {
     await AsyncEnumerable.CombineLatest(v => v.Sum(), AsyncEnumerable.Just(1), AsyncEnumerable.Empty <int>())
     .AssertResult();
 }
Example #19
0
 public IAsyncEnumerable <DocumentItem> GetLegacyAttachmentsAsync(INewDocumentActions actions)
 {
     return(AsyncEnumerable.Empty <DocumentItem>());
 }
Example #20
0
 public ValueTask <int[]> Linq_AsyncEnumerable_Reference()
 => AsyncEnumerable.Where(asyncEnumerableReference, item => (item & 0x01) == 0)
 .ToArrayAsync();
Example #21
0
 public IAsyncEnumerable <CounterDetail> GetLegacyCounterValuesAsync()
 {
     // used only in StreamSource
     return(AsyncEnumerable.Empty <CounterDetail>());
 }
Example #22
0
 /// <nodoc />
 public IAsyncEnumerable <StructResult <StrongFingerprint> > EnumerateStrongFingerprints(Context context)
 {
     return(AsyncEnumerable.Empty <StructResult <StrongFingerprint> >());
 }
 public async void Skip_All()
 {
     await AsyncEnumerable.Range(1, 5)
     .SkipUntil(AsyncEnumerable.Timer(TimeSpan.FromMilliseconds(250)))
     .AssertResult();
 }
Example #24
0
 /// <inheritdoc />
 public Async::System.Collections.Generic.IAsyncEnumerable <StructResult <StrongFingerprint> > EnumerateStrongFingerprints(Context context)
 {
     return(AsyncEnumerable.Empty <StructResult <StrongFingerprint> >());
 }
Example #25
0
 public ValueTask <int> Linq_AsyncEnumerable_Value()
 => AsyncEnumerable.CountAsync(asyncEnumerableValue);
Example #26
0
 /// <param name="cancellationToken"></param>
 /// <inheritdoc />
 public IAsyncEnumerable <ICommandInfo> GetSubCommandsAsync(CancellationToken cancellationToken)
 => AsyncEnumerable.Empty <ICommandInfo>();
Example #27
0
        public async Task Empty_Sources()
        {
            var to = await AsyncEnumerable.Concat(AsyncEnumerable.Empty <int>(), AsyncEnumerable.Empty <int>(), AsyncEnumerable.Empty <int>())
                     .TestAsync();

            to.AssertResult();
        }
Example #28
0
        public async Task TakeAsync_Empty()
        {
            var enumerable = AsyncEnumerable.EmptyAsync <int>();

            Assert.AreEqual(0, await enumerable.TakeAsync(10).CountAsync());
        }
Example #29
0
 public async void Normal()
 {
     await AsyncEnumerable.Empty <int>()
     .AssertResult();
 }
Example #30
0
 private static IAsyncEnumerable <T> ToSequenceShim <T>(T element)
 {
     return(AsyncEnumerable.Return(element));
 }