public void VerifyCanOkExecute() { var name = "name"; var createdOn = DateTime.UtcNow; this.folder.Owner = this.domainOfExpertise; var folderDialogViewModel = new FolderDialogViewModel(this.folder, this.thingTransaction, this.session.Object, true, ThingDialogKind.Create, this.thingDialogNavigationService.Object, this.domainFileStoreClone); Assert.IsFalse(folderDialogViewModel.OkCanExecute); folderDialogViewModel.Name = name; Assert.IsTrue(folderDialogViewModel.OkCanExecute); folderDialogViewModel.Name = default; Assert.IsFalse(folderDialogViewModel.OkCanExecute); folderDialogViewModel.CreatedOn = default; Assert.IsFalse(folderDialogViewModel.OkCanExecute); folderDialogViewModel.SelectedOwner = default; Assert.IsFalse(folderDialogViewModel.OkCanExecute); folderDialogViewModel.Name = name; Assert.IsFalse(folderDialogViewModel.OkCanExecute); folderDialogViewModel.CreatedOn = createdOn; Assert.IsFalse(folderDialogViewModel.OkCanExecute); folderDialogViewModel.SelectedOwner = this.domainOfExpertise; Assert.IsTrue(folderDialogViewModel.OkCanExecute); }
public void VerifyThatPropertiesAreSetForNewFolder() { var folderDialogViewModel = new FolderDialogViewModel(this.folder, this.thingTransaction, this.session.Object, true, ThingDialogKind.Create, this.thingDialogNavigationService.Object, this.domainFileStoreClone); Assert.AreNotEqual(DateTime.MinValue, folderDialogViewModel.CreatedOn); Assert.AreEqual(this.domainOfExpertise, folderDialogViewModel.SelectedOwner); Assert.AreSame(this.domainFileStoreClone, folderDialogViewModel.Container); Assert.IsTrue(folderDialogViewModel.PossibleOwner.Any()); Assert.IsNull(this.folder.ContainingFolder); }
public void VerifyOkExecute() { var name = "name"; var createdOn = DateTime.UtcNow; this.folder.Name = name; this.folder.CreatedOn = createdOn; this.folder.Owner = this.domainOfExpertise; var folderDialogViewModel = new FolderDialogViewModel(this.folder, this.thingTransaction, this.session.Object, true, ThingDialogKind.Create, this.thingDialogNavigationService.Object, this.domainFileStoreClone); folderDialogViewModel.OkCommand.Execute(null); this.session.Verify(x => x.Write(It.IsAny <OperationContainer>())); }
public void VerifyThatPropertiesAreSet() { var name = "name"; var createdOn = DateTime.UtcNow; this.folder.Name = name; this.folder.CreatedOn = createdOn; this.folder.Owner = this.domainOfExpertise; var folderDialogViewModel = new FolderDialogViewModel(this.folder, this.thingTransaction, this.session.Object, true, ThingDialogKind.Create, this.thingDialogNavigationService.Object, this.domainFileStoreClone); Assert.AreEqual(name, folderDialogViewModel.Name); Assert.AreEqual(createdOn, folderDialogViewModel.CreatedOn); Assert.AreEqual(this.domainOfExpertise, folderDialogViewModel.SelectedOwner); Assert.AreSame(this.domainFileStoreClone, folderDialogViewModel.Container); Assert.IsTrue(folderDialogViewModel.PossibleOwner.Any()); }
public FolderDialogView(FolderDialogViewModel vm) { InitializeComponent(); DataContext = vm; }
public void VerifyThatDefaultConstructorIsAvailable() { var folderDialogViewModel = new FolderDialogViewModel(); Assert.IsNotNull(folderDialogViewModel); }