예제 #1
0
 public void CancelCommand_ShouldRaisePropertyChangedEventWhenAltered()
 {
     _viewModel = new SelectReportModelDialogViewModel(_modelList);
     _viewModel.AssertRaisesPropertyChangedFor("CancelCommand");
     // Exercise system
     _viewModel.CancelCommand = new RelayCommand(x => { });
 }
예제 #2
0
 public void DialogResult_ShouldRaisePropertyChangedEventWhenAltered()
 {
     _viewModel = new SelectReportModelDialogViewModel(_modelList);
     _viewModel.AssertRaisesPropertyChangedFor("DialogResult");
     // Exercise system
     _viewModel.DialogResult = false;
 }
예제 #3
0
 public void SelectedDataModel_ShouldRaisePropertyChangedEventWhenAltered()
 {
     _viewModel = new SelectReportModelDialogViewModel(_modelList);
     _viewModel.AssertRaisesPropertyChangedFor("SelectedDataModel");
     // Exercise system
     _viewModel.SelectedDataModel = new DataModel {
         Name = "NewModel"
     };
 }
예제 #4
0
 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}
 }
예제 #5
0
 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}
 }
예제 #6
0
 public void Constructor_ShouldInitialiseTheCancelCommandAsExecutable()
 {
     _viewModel = new SelectReportModelDialogViewModel(_modelList);
     Assert.IsTrue(_viewModel.CancelCommand.CanExecute(null) == true);
 }
예제 #7
0
 public void Constructor_ShouldLeaveSelectedDataModelUnset()
 {
     _viewModel = new SelectReportModelDialogViewModel(_modelList);
     Assert.IsTrue(_viewModel.SelectedDataModel == null);
 }
예제 #8
0
 public void Constructor_ShouldSetTheDataModels()
 {
     _viewModel = new SelectReportModelDialogViewModel(_modelList);
     //TestHelpers.AreCollectionsItemsEqual<DataModel>(_viewModel.DataModels, _modelList);
     CollectionAssert.AreEquivalent(_viewModel.DataModels, _modelList);
 }