コード例 #1
0
        public void TestBindNewViewModel()
        {
            DummyBinding binding = new DummyBinding();

            binding.ViewModel = new ViewModelBase <BindableBase> ();
            binding.ViewModel = new ViewModelBase <BindableBase> ();
            binding.Dispose();

            Assert.AreEqual(0, binding.viewBindCount);
            Assert.AreEqual(0, binding.viewModelBindCount);
        }
コード例 #2
0
        public void TestUnbindViewInDispose()
        {
            var viewModel = new ViewModelBase <BindableBase> ();

            DummyBinding binding = new DummyBinding();

            binding.ViewModel = viewModel;
            binding.Dispose();

            Assert.AreEqual(0, binding.viewBindCount);
            Assert.AreEqual(0, binding.viewModelBindCount);
        }