public void TestSetPropertiesForDialogIsDialogFalse()
        {
            //arrange
            var windowsGroupPermissionMock = new Mock <IWindowsGroupPermission>();

            windowsGroupPermissionMock.SetupGet(it => it.Contribute).Returns(true);
            windowsGroupPermissionMock.SetupGet(it => it.Administrator).Returns(true);
            windowsGroupPermissionMock.SetupGet(it => it.IsServer).Returns(true);
            _serverMock.SetupGet(it => it.Permissions).Returns(new List <IWindowsGroupPermission>()
            {
                windowsGroupPermissionMock.Object
            });

            //act
            _target.SetPropertiesForDialog();

            //assert
            Assert.IsFalse(_target.AllowResourceCheck);
            Assert.IsFalse(_target.IsResourceChecked ?? true);
            Assert.IsTrue(_target.CanCreateSource);
            Assert.IsTrue(_target.CanCreateFolder);
            Assert.IsFalse(_target.CanDelete);
            Assert.IsFalse(_target.CanDeploy);
            Assert.IsFalse(_target.CanRename);
            Assert.IsFalse(_target.CanRollback);
            Assert.IsFalse(_target.CanShowVersions);
            Assert.IsTrue(_target.CanCreateWorkflowService);
            Assert.IsTrue(_target.ShowContextMenu);
        }
Exemple #2
0
        public void TestSetPropertiesForDialogIsDialogTrue()
        {
            //arrange
            _target = new EnvironmentViewModel(_serverMock.Object, _shellViewModelMock.Object, true);

            //act
            _target.SetPropertiesForDialog();

            //assert
            Assert.IsFalse(_target.AllowResourceCheck);
            Assert.IsFalse(_target.CanCreateSource);
            Assert.IsFalse(_target.CanCreateWorkflowService);
            Assert.IsFalse(_target.ShowContextMenu);
            Assert.IsFalse(_target.CanDeploy);
        }