public async Task TracksTheEventWhenUserDoesNotHaveDefaultWorkspace() { var user = new MockUser(); user.DefaultWorkspaceId = null; fetchObservables.GetSingle <IUser>().Returns(Observable.Return <IUser>(user)); await state.Start(fetchObservables); analyticsService.NoDefaultWorkspace.Received().Track(); }
public IObservable <ITransition> Start(IFetchObservables fetch) => fetch.GetSingle <TInterface>() .SingleAsync() .SelectMany(entity => entity == null ? Observable.Return(Unit.Default) : dataSource.UpdateWithConflictResolution(convertToThreadsafeEntity(entity)).Select(_ => Unit.Default)) .Select(_ => FinishedPersisting.Transition(fetch));
protected override IObservable <T> FetchObservable(IFetchObservables fetch) => fetch.GetSingle <T>();