Esempio n. 1
0
        public UserServiceTest()
        {
            userRepository = new StubUserRepository();
            IRoleRepository roleRepository   = new StubRoleRepository();
            string          ROLE_ID          = "admin";
            string          ROLE_DESCRIPTION = "Administrador de Sistema";
            Role            role             = new Role(ROLE_ID, ROLE_DESCRIPTION);

            roleRepository.AddEntity(role);
            IUserManager userManager = new UserManager(userRepository, roleRepository);

            userService = new UserServiceImpl(userManager, new UserDTOBuilder());
            string USER_NAME     = "Juan";
            string USER_LASTNAME = "Perez";
            string USER_ADDRESS  = "Ejido 1928";
            string USER_EMAIL    = "*****@*****.**";
            string USER_PASSWORD = "******";

            request              = new UserRequest();
            request.UserId       = USER_ID;
            request.Address      = USER_ADDRESS;
            request.UserLastName = USER_LASTNAME;
            request.UserName     = USER_NAME;
            request.EMail        = USER_EMAIL;
            request.Password     = USER_PASSWORD;
            request.RoleId       = ROLE_ID;
        }
        private IRoleRepository GetRoleRepository()
        {
            IRoleRepository roleRepository   = new StubRoleRepository();
            string          ROLE_DESCRIPTION = "Administrador de Sistema";
            Role            role             = new Role(ROLE_ID, ROLE_DESCRIPTION);

            roleRepository.AddEntity(role);
            return(roleRepository);
        }