Ejemplo n.º 1
0
        public void OnUserRoleAssign(Select2 <ProcessRole> select, string roleId)
        {
            RedoableCommands.Clear();
            var assignedRole    = _userModelManager.GetProcessRoles().Where(r => r.Id == roleId).FirstOrDefault();
            var assignedCommand = new AssignRoleCommand(_userModelManager, assignedRole, select);

            UndoableCommands.Push(assignedCommand);
        }
Ejemplo n.º 2
0
        public void AddNewRole_ShouldAdd()
        {
            var addedRole = _userModelManager.AddNewRole();

            Assert.Single(_contract.Roles);
            Assert.Contains(addedRole, _contract.Roles);
            Assert.Equal(_contract.Roles, _userModelManager.GetProcessRoles());
        }