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); }
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); }