public void NotifyPropertyChangedTests() { var modelMock = Mock.Create<IPageableList>(Behavior.CallOriginal); var vm = new PageItem(modelMock); TestsHelper.TestPropertyWithNotifyPropertyChanged(vm, () => vm.IsChecked); }
public void PublicPropertiesGetSetTest() { var modelMock = Mock.Create<IPageableList>(Behavior.CallOriginal); var vm = new PageItem(modelMock); TestsHelper.TestPublicPropertiesGetSet(vm); }
public void PageCommandTest() { var modelRefreshInvoked = false; var modelPageNumber = -1; var modelMock = Mock.Create<IPageableList>(Behavior.CallOriginal); Mock.Arrange(() => modelMock.Refresh(Arg.IsAny<int>())).DoInstead( (int page) => { modelRefreshInvoked = true; modelPageNumber = page; }); var vm = new PageItem(modelMock) { PageNumber = 123, IsChecked = false }; vm.PageCommand.Execute(null); Assert.IsTrue(modelRefreshInvoked); Assert.AreEqual(vm.PageNumber, modelPageNumber); Assert.IsTrue(vm.IsChecked); }