private IObservable <Item> AskPurchaseIfNotPurchased(Item item) { return(item.IsPurchased ? Observable.Return(item) : _view.ShowPurchaseConfirmation(item) .SelectMany(success => success ? PurchaseItem(item) : Observable.Empty <Item>())); }
private void SetUpView() { _view = Substitute.For <CustomizationView>(); _view.CategorySelected.Returns(_categorySelected.AsObservable()); _view.ItemSelected.Returns(_itemSelected.AsObservable()); _view.OnComplete.Returns(_complete.AsObservable()); _view.OnEnabled.Returns(_enabled.AsObservable()); _view.ShowPurchaseConfirmation(Arg.Any <Item>()).Returns(_confirmPurchase.AsObservable()); }