Exemplo n.º 1
0
        public void TestReleasingTargetForExecuteGenericInternal()
        {
            _tempoInstance = new TemporaryClass();
            _reference     = new WeakReference(_tempoInstance);

            _tempoInstance.CreateCommandGenericInternal();

            Assert.IsTrue(_reference.IsAlive);

            _tempoInstance = null;
            GC.Collect();

            Assert.IsFalse(_reference.IsAlive);
        }
Exemplo n.º 2
0
        public void TestReleasingTargetForExecuteGeneric()
        {
            _tempoInstance = new TemporaryClass();
            _reference     = new WeakReference(_tempoInstance);

            TestCommand = new RelayCommand <string>(
                _tempoInstance.SetContent);

            Assert.IsTrue(_reference.IsAlive);

            _tempoInstance = null;
            GC.Collect();

            Assert.IsFalse(_reference.IsAlive);
        }
Exemplo n.º 3
0
        public void TestReleasingTargetForCanExecute()
        {
            _tempoInstance = new TemporaryClass();
            _reference     = new WeakReference(_tempoInstance);

            TestCommand = new RelayCommand(
                _tempoInstance.SetContent,
                _tempoInstance.CheckEnabled);

            Assert.IsTrue(_reference.IsAlive);

            _tempoInstance = null;
            GC.Collect();

            Assert.IsFalse(_reference.IsAlive);
        }
        public void TestReleasingTargetForExecuteGenericInternal()
        {
            _tempoInstance = new TemporaryClass();
            _reference = new WeakReference(_tempoInstance);

            _tempoInstance.CreateCommandGenericInternal();

            Assert.IsTrue(_reference.IsAlive);

            _tempoInstance = null;
            GC.Collect();

            Assert.IsFalse(_reference.IsAlive);
        }
        public void TestReleasingTargetForExecuteGeneric()
        {
            _tempoInstance = new TemporaryClass();
            _reference = new WeakReference(_tempoInstance);

            TestCommand = new RelayCommand<string>(
                _tempoInstance.SetContent);

            Assert.IsTrue(_reference.IsAlive);

            _tempoInstance = null;
            GC.Collect();

            Assert.IsFalse(_reference.IsAlive);
        }
Exemplo n.º 6
0
        public void TestReleasingTargetForCanExecute()
        {
            _tempoInstance = new TemporaryClass();
            _reference = new WeakReference(_tempoInstance);

            TestCommand = new RelayCommand(
                _tempoInstance.SetContent,
                _tempoInstance.CheckEnabled);

            Assert.IsTrue(_reference.IsAlive);

            _tempoInstance = null;
            GC.Collect();

            Assert.IsFalse(_reference.IsAlive);
        }
        public void TestReleasingTargetForCanExecuteGeneric()
        {
            _tempoInstance = new TemporaryClass();
            _reference = new WeakReference(_tempoInstance);

            TestCommand = new RelayCommand<string>(
                _tempoInstance.SetContent,
                _tempoInstance.CheckEnabled);

            Assert.IsTrue(_reference.IsAlive);

            _tempoInstance = null;
            GC.Collect();

#if NETFX_CORE
            Assert.IsTrue(_reference.IsAlive);
            TestCommand = null;
            GC.Collect();
            Assert.IsFalse(_reference.IsAlive);
#else
            Assert.IsFalse(_reference.IsAlive);
#endif
        }