Ejemplo n.º 1
0
        public GetRoleResponse GetRoleById(GetRoleRequest request)
        {
            GetRoleResponse response = new GetRoleResponse();
            SecurityBusinessComponent bc = DependencyInjectionHelper.GetSecurityBusinessComponent();

            Role role = bc.GetRoleById(request.RoleId);
            response.Role = SecurityAdapter.RoleToDTO(role);

            return response;
        }
Ejemplo n.º 2
0
        public void TestGetRole()
        {
            int roleId = 1;
            GetRoleResponse response = new GetRoleResponse();
            response.Role = new RoleDTO() { Id = roleId };

            Expect.Once.On(service).Method("GetRoleById").Will(Return.Value(response));
            RoleDTO role = serviceFacade.GetRoleById(roleId);
            Assert.AreEqual(role.Id, roleId);
        }