Exemple #1
0
        public void HelloWorldReactiveVM_Dispose()
        {
            bool dispose = false;
            var  vm      = new HelloWorldReactiveVM();

            vm.Disposed += (sender, e) => dispose = true;

            var vmController = new MockVMController <HelloWorldReactiveVM>(vm);

            vmController.RequestVM();

            vmController.DisposeVM();
            Assert.IsTrue(dispose);
        }
        public void MasterDetailsVM_SubVMDisposing()
        {
            object subVM          = null;
            bool   subVMDisposing = false;

            _masterVM.SubVMDisposing += (sender, e) => { subVM = sender; subVMDisposing = true; };

            var vmController = new MockVMController <MasterVM>(_masterVM);

            vmController.RequestVM(_detailsVMId);

            vmController.DisposeVM(_detailsVMId);
            Assert.IsTrue(subVMDisposing);
            Assert.IsTrue(subVM is DetailsVM);
        }