public void TestProperties() { var vm = new GridColumnViewModel(null, null, null); TestsHelper.TestPropertyWithNotifyPropertyChanged(vm, () => vm.CanChangeGroupLevel); TestsHelper.TestPropertyWithNotifyPropertyChanged(vm, () => vm.CanChangeSortDirection); TestsHelper.TestPropertyWithNotifyPropertyChanged(vm, () => vm.CanChangeSortLevel); }
public void InitializeDefaultValues() { // arrange var vm = new GridColumnViewModel(new List<IGridColumn>(), "Id", Mock.Create<INotifyLayoutChanged>(Behavior.CallOriginal)) { CanChangeGroupLevel = false, CanChangeSortDirection = false, CanChangeSortLevel = false, }; Mock.Arrange(() => vm.SortDirection).Returns(SortDirection.Ascending); // assert new PrivateAccessor(vm).CallMethod("InitializeDefaultValues"); // assert Assert.IsFalse(vm.CanChangeGroupLevel); Assert.IsTrue(vm.CanChangeSortDirection); Assert.IsTrue(vm.CanChangeSortLevel); }