Exemplo n.º 1
0
        public async Task Throwing()
        {
            string result  = "";
            var    subject = new UnicastAsyncSubject <int>();

            var s = subject.SubscribeAsync(i => result += i, onCompleted: () => result += "C", onError: ex => result += "E");

            await subject.OnSubscribeAsync(Disposable.Empty);

            await subject.OnNextAsync(0);

            await subject.OnErrorAsync(new Exception());

            await subject.OnFinallyAsync();

            await s;

            result
            .Should().Be("0E");
        }