Catel.Test.MVVM.CompositeCommandFacts.TheAutoUnsubscribeFunctionality.AutomaticallyUnsubscribesCommandOnViewModelClosed C# (CSharp) 메소드

AutomaticallyUnsubscribesCommandOnViewModelClosed() 개인적인 메소드

private AutomaticallyUnsubscribesCommandOnViewModelClosed ( ) : System.Threading.Tasks.Task
리턴 System.Threading.Tasks.Task
            public async Task AutomaticallyUnsubscribesCommandOnViewModelClosed()
            {
                var vm = new CompositeCommandViewModel();
                var compositeCommand = new CompositeCommand();

                compositeCommand.RegisterCommand(vm.TestCommand1, vm);

                Assert.IsFalse(vm.IsTestCommand1Executed);

                await vm.CloseViewModelAsync(false);

                compositeCommand.Execute();

                Assert.IsFalse(vm.IsTestCommand1Executed);
            }
        }
CompositeCommandFacts.TheAutoUnsubscribeFunctionality