Beispiel #1
0
        public async void TestIObservableToEnumerableFirstOrDefault()
        {
            var collection = new SimpleObservable();
            var results    = collection.ToEnumerable();

            collection.Start();
            Assert.Equal("number: 0", results.FirstOrDefault());
        }
Beispiel #2
0
        public async void TestIObservableToReEnumerable()
        {
            var collection = new SimpleObservable();
            var results    = collection.ReEnumerable();

            collection.Start();

            Assert.True(results.SequenceEqual(new[] { "number: 0", "number: 1", "number: 2", "number: 3", "number: 4", "number: 5", "number: 6", "number: 7", "number: 8", "number: 9" }));
        }
Beispiel #3
0
        public async void TestAwaitIObservable()
        {
            var collection           = new SimpleObservable();
            IObservable <string> foo = collection;

            collection.Start();

            Console.WriteLine($"Time: {DateTime.Now}");
            await foo;

            Console.WriteLine($"Time: {DateTime.Now}");

            Assert.True(true);
        }