示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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>()));
        }
示例#4
0
        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;
 }
示例#6
0
        public void VerifyThatDefaultConstructorIsAvailable()
        {
            var folderDialogViewModel = new FolderDialogViewModel();

            Assert.IsNotNull(folderDialogViewModel);
        }