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()); }
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()); }
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>())); }
public void ShouldErrorOnRecords() { var exc = new ClientException("some error"); var cursor = CreateFailingResultCursor(exc); var result = new RxResult(Observable.Return(cursor)); VerifyError(result.Records(), exc); }
public void ShouldNotReturnRecordsIfSummaryIsObserved() { var cursor = CreateResultCursor(3, 0, "my query"); var result = new RxResult(Observable.Return(cursor)); VerifySummary(result, "my query"); VerifyResultConsumedError(result.Records()); }
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()); }
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()); }