public void CancelCommand_ShouldRaisePropertyChangedEventWhenAltered() { _viewModel = new SelectReportModelDialogViewModel(_modelList); _viewModel.AssertRaisesPropertyChangedFor("CancelCommand"); // Exercise system _viewModel.CancelCommand = new RelayCommand(x => { }); }
public void DialogResult_ShouldRaisePropertyChangedEventWhenAltered() { _viewModel = new SelectReportModelDialogViewModel(_modelList); _viewModel.AssertRaisesPropertyChangedFor("DialogResult"); // Exercise system _viewModel.DialogResult = false; }
public void SelectedDataModel_ShouldRaisePropertyChangedEventWhenAltered() { _viewModel = new SelectReportModelDialogViewModel(_modelList); _viewModel.AssertRaisesPropertyChangedFor("SelectedDataModel"); // Exercise system _viewModel.SelectedDataModel = new DataModel { Name = "NewModel" }; }
public void OKCommand_ShouldBeTrueAfterDataModelSelected() { // Exercise system _viewModel = new SelectReportModelDialogViewModel(_modelList); _viewModel.SelectedDataModel = new DataModel { Name = "NewModel" }; // Verify outcome Assert.IsTrue(_viewModel.OKCommand.CanExecute(null), "Command Can not be executed"); // Teardown} }
public void CancelCommandExecute_ShouldSetTheDialogResultToFalse() { _viewModel = new SelectReportModelDialogViewModel(_modelList); // Exercise system _viewModel.SelectedDataModel = new DataModel { Name = "NewModel" }; // Verify outcome _viewModel.CancelCommand.Execute(null); Assert.IsTrue(_viewModel.DialogResult.Value == false, "Cancel Command has not set the dialog result"); // Teardown} }
public void Constructor_ShouldInitialiseTheCancelCommandAsExecutable() { _viewModel = new SelectReportModelDialogViewModel(_modelList); Assert.IsTrue(_viewModel.CancelCommand.CanExecute(null) == true); }
public void Constructor_ShouldLeaveSelectedDataModelUnset() { _viewModel = new SelectReportModelDialogViewModel(_modelList); Assert.IsTrue(_viewModel.SelectedDataModel == null); }
public void Constructor_ShouldSetTheDataModels() { _viewModel = new SelectReportModelDialogViewModel(_modelList); //TestHelpers.AreCollectionsItemsEqual<DataModel>(_viewModel.DataModels, _modelList); CollectionAssert.AreEquivalent(_viewModel.DataModels, _modelList); }