Questions tagged [rxtest]

23 questions
1
vote
1 answer

Test PublishSubject for ViewState

I'm trying to test the main functionality of my ViewModel. The important step is to test te loaded state completed. But for sure, for a better test it could be interesting to test al states. I was reading a lot of post and information about RxTest…
Michel Marqués
  • 161
  • 1
  • 2
  • 10
0
votes
1 answer

How to test multiple events in RxTest

We are currently implementing unit tests for our ViewModel. When a requestInAppPayment Input request comes in from the view model, subscription is implemented only when the instance property isPurchasing filter is false (to prevent multiple touches…
Jiss
  • 3
  • 1
0
votes
1 answer

XCTAssertEqual fails when using createColdObservable for RxTest

I have a strange issue in my testing code. I want to test a BehaviourRelay in my view model changes from status .fetching to .saving. I have the following test code: class BankViewModelTests: XCTestCase { private var scheduler:…
Kex
  • 8,023
  • 9
  • 56
  • 129
0
votes
1 answer

RxSwift TestScheduler for two sources

I would like to emit two different signals for two different sources, but I get crash Thread 1: EXC_BAD_ACCESS (code=1, address=0x0) in RxSwift/Event.swift in line 29: return "next(\(value))" this is my simplified code: let scheduler =…
milczi
  • 7,064
  • 2
  • 27
  • 22
0
votes
1 answer

How to test a private function inside an RxSwift observer?

observable.subscribe(onNext: { _ in somePrivateFunction() }) What is the RxSwift way to test that when observable receives an event the somePrivateFunction actually gets called or not? Since the subscription and the function are in the same…
Daniyal Raza
  • 352
  • 3
  • 13
0
votes
1 answer

Unable to access toBlocking() in xctest

I am trying to write test cases and trying to access a method which returns Single object. For this I want to use toBlocking but I am not able to access it and getting following error: Value of type 'Single<[Property]>' (aka …
Panks
  • 565
  • 1
  • 7
  • 20
0
votes
1 answer

Testing BehaviorSubject/Relay in RxSwift

I'm having trouble testing a BehaviorRelay. The following minimal code binds an observable to a BehaviorRelay, but when testing, the tests won't end and are hung - the observable keeps emitting events, because it starts with Observable.timer. When…
az4dan
  • 651
  • 2
  • 10
  • 30
-1
votes
1 answer

How to test a WKWebView using RxWebKit?

I'm trying to write some tests for my application, that uses rxSwift. In particular, I'd like to test, writing unit tests, a webview. I'm using RxWebKit to get observables over some properties like navigationCompleted or NavigationFailed and so…
Giuseppe Pennisi
  • 396
  • 3
  • 22
1
2