Example #1
0
        public int MethodTwo(IObservable <string> observable)
        {
            DisposableTestContainer.Add(
                observable.Subscribe());

            return(1);
        }
Example #2
0
        // The returned disposable *should not* be disposed when the class is
        public IDisposable MethodWithoutObleak()
        {
            var disposable = this.WhenAnyValue(x => x.StringProperty).Subscribe();

            DisposableTestContainer.Add(disposable);
            return(disposable);
        }
Example #3
0
        public void SubscribeToNewObservableAndCallComplexMethodOne()
        {
            DisposableTestContainer.Add(
                this.WhenAnyValue(x => x.StringProperty).Subscribe());

            // This will call subscrbe within MethodModel and again here on the subject.
            ComplexMethodOne();
        }
Example #4
0
        public void SingleMethod(IObservable <string> observable)
        {
            DisposableTestContainer.Add(
                observable.Subscribe());

            DisposableTestContainer.Add(
                this.WhenAnyValue(x => x.StringProperty).Subscribe());
        }
Example #5
0
        public SingleComplexConstructorIheritedFromSingleConstructorThreeSubscribeModel()
        {
            var i = 5;

            DisposableTestContainer.Add(
                this.WhenAnyValue(x => x.StringProperty, x => x == "Test").Subscribe(_ => i = MultiplyByTwo(i)));
            StringProperty = "Test";
        }
Example #6
0
        public ComplexClass()
        {
            SerialDisposable = new SerialDisposable();
            MethodModel      = new ThreeMethodsWithMultipleSubscribesModel();
            Subject          = new Subject <string>();

            DisposableTestContainer.Add(
                this.WhenAnyValue(x => x.StringProperty).Subscribe());
        }
Example #7
0
        public IDisposable MethodThree()
        {
            var disposable = this.WhenAnyValue(x => x.StringProperty).Subscribe();

            DisposableTestContainer.Add(disposable);

            DisposableTestContainer.Add(
                Observable.FromAsync(_ => Task.FromResult(true)).Subscribe());

            return(disposable);
        }
Example #8
0
        public SingleConstructorThreeSubscribesModel()
        {
            DisposableTestContainer.Add(
                this.WhenAnyValue(x => x.StringProperty).Subscribe());

            DisposableTestContainer.Add(
                Observable.FromAsync(_ => Task.FromResult(true)).Subscribe());

            DisposableTestContainer.Add(
                this.WhenAnyValue(x => x.StringProperty).Subscribe());
        }
Example #9
0
        public void ComplexMethodOne()
        {
            var disposable = MethodModel.MethodThree();

            SerialDisposable.Disposable = disposable;

            // First Disposable
            DisposableTestContainer.Add(
                Subject
                .StartWith("TestString")
                .ObserveOn(RxApp.MainThreadScheduler)
                .Subscribe(_ =>
            {
                // Second disposable; note the StartWith meaning the subject doesn't have to fire for this to be hit
                MethodOne();
                _intValue = MultiplyByTwo(73);
            },
                           exception => { },
                           () => _intValue = MultiplyByTwo(_intValue)));

            // Third disposable
            DisposableTestContainer.Add(disposable);
        }
Example #10
0
 public void MethodOne()
 {
     DisposableTestContainer.Add(
         this.WhenAnyValue(x => x.StringProperty).Subscribe());
 }
Example #11
0
 public TwoConstructorsOnlyOneWithObleakAttributeModel(bool a)
 {
     DisposableTestContainer.Add(
         this.WhenAnyValue(x => x.StringProperty).Subscribe());
 }
Example #12
0
 public TwoConstructorsSingleSubscribeModel(bool b)
 {
     DisposableTestContainer.Add(
         this.WhenAnyValue(x => x.StringProperty).Subscribe());
 }
Example #13
0
 public void FireSubjectAndSubscribeToNewObservable()
 {
     Subject.OnNext("Yes");
     DisposableTestContainer.Add(
         this.WhenAnyValue(x => x.StringProperty).Subscribe());
 }
Example #14
0
 public void MethodOne()
 {
     DisposableTestContainer.Add(
         Observable.FromAsync(_ => Task.FromResult(true)).Subscribe());
 }
Example #15
0
 public ClassSingleConstructorTwoMethods()
 {
     DisposableTestContainer.Add(
         this.WhenAnyValue(x => x.StringProperty).Subscribe());
 }