Example #1
0
            public void ShouldErrorOnRecordsRepeatable()
            {
                var keys     = new[] { "key01", "key02" };
                var failure1 = new DatabaseException("code", "message");
                var cursor   = CreateFailingResultCursor(failure1, 2, 5);
                var result   = new RxResult(Observable.Return(cursor));

                VerifyRecordsAndError(result, keys, 5, failure1);
                VerifyResultConsumedError(result.Records());
                VerifyResultConsumedError(result.Records());
            }
Example #2
0
            public void ShouldErrorOnRecordsRepeatable()
            {
                var exc    = new ClientException("some error");
                var cursor = CreateFailingResultCursor(exc);
                var result = new RxResult(Observable.Return(cursor), new TestLogger(Output.WriteLine));

                VerifyError(result.Records(), exc);

                VerifyResultConsumedError(result.Records());
                VerifyResultConsumedError(result.Records());
            }
Example #3
0
            public void ShouldNotAllowConcurrentRecordObservers()
            {
                var cursor = CreateResultCursor(3, 20, "my query", 1000);
                var result = new RxResult(Observable.Return(cursor));

                result.Records()
                .Merge(result.Records())
                .WaitForCompletion()
                .AssertEqual(
                    OnError <IRecord>(0, MatchesException <ClientException>()));
            }
Example #4
0
            public void ShouldErrorOnRecords()
            {
                var exc    = new ClientException("some error");
                var cursor = CreateFailingResultCursor(exc);
                var result = new RxResult(Observable.Return(cursor));

                VerifyError(result.Records(), exc);
            }
Example #5
0
            public void ShouldNotReturnRecordsIfSummaryIsObserved()
            {
                var cursor = CreateResultCursor(3, 0, "my query");
                var result = new RxResult(Observable.Return(cursor));

                VerifySummary(result, "my query");
                VerifyResultConsumedError(result.Records());
            }
Example #6
0
            public void ShouldNotReturnRecordsIfRecordsIsAlreadyObserved()
            {
                var keys   = new[] { "key01", "key02", "key03" };
                var cursor = CreateResultCursor(3, 5);
                var result = new RxResult(Observable.Return(cursor));

                VerifyRecords(result, keys, 5);
                VerifyResultConsumedError(result.Records());
            }
Example #7
0
            public void ShouldErrorOnKeysRecordsAndButNotOnSummary()
            {
                var exc    = new ClientException("some error");
                var cursor = CreateFailingResultCursor(exc);
                var result = new RxResult(Observable.Return(cursor));

                VerifyError(result.Keys(), exc);
                VerifyError(result.Records(), exc);
                VerifyNoError(result.Consume());
            }