Beispiel #1
0
        public async Task AddUser_AfterAdded_Success()
        {
            AddUserService addUserService = new AddUserService(
                UserManagerMock.Create().WithCreateSuccess().Object,
                SignInManagerMock.Create().Object,
                IEmailConfirmationServiceMock.Create().SendVerificationMailSuccess().Object,
                IGroupUserServiceMock.Create().Object,
                IAddUserFilterMock.Create().BeforeAdd_Success().AfterAdded_Success().Object,
                IBaseDAOMock<AppUserEntity>.Create().Object,
                IBaseDAOMock<InviteEntity>.Create().Object,
                IBaseDAOMock<RoleEntity>.Create().Object,
                IOptionsMock<IdentityUIEndpoints>.Create().DefaultValue().Object,
                IValidatorMock<NewUserRequest>.Create().Object,
                IValidatorMock<RegisterRequest>.Create().Object,
                IValidatorMock<AcceptInviteRequest>.Create().Object,
                IValidatorMock<ExternalLoginRegisterRequest>.Create().Object,
                IValidatorMock<GroupBaseUserRegisterRequest>.Create().Object,
                IValidatorMock<BaseRegisterRequest>.Create().Validate_Valid().Object,
                IValidatorMock<IUserAttributeRequest>.Create().Validate_Valid().Object,
                NullLogger<AddUserService>.Instance);

            BaseRegisterRequest baseRegisterRequest = new Fixture()
                .Build<BaseRegisterRequest>()
                .Create();

            Result<AppUserEntity> result = await addUserService.AddUser(baseRegisterRequest);

            result.Success.Should().BeTrue();
        }
Beispiel #2
0
 public async Task <IActionResult> DeleteUserTimer([FromBody] DeleteTimerUser request)
 {
     AddUserService.DeleteUser(request.UserId, request.UserName);
     return(Json(new KlineResponse {
         Success = true,
     }));
 }
        public bool AddAccount(UserAccount useraccount)
        {
            AddUserService us    = new AddUserService();
            bool           state = us.AddAccount(useraccount);

            return(state);
        }
        public IEnumerable <spSearch_Result> Search([FromBody] string letter)
        {
            AddUserService us    = new AddUserService();
            var            state = us.Search(letter);

            return(state);
        }
        public bool AddUser(User user)
        {
            AddUserService us    = new AddUserService();
            bool           state = us.AddUser(user);

            return(state);
        }
Beispiel #6
0
        public async Task <IActionResult> RealTime([FromBody] DataOfRealTimeRequest request)
        {
            var user = UserService.GetAll().FirstOrDefault(x => x.Login == User.Identity.Name);

            AddUserService.AddUser(request);
            return(Json(new KlineResponse {
                Success = true,
            }));
        }
Beispiel #7
0
 public UsersController(
     ShowUserService showUserService,
     AddUserService addUserService,
     UpdateUserService updateUserService,
     DeleteUserService deleteUserService)
 {
     _showUserService   = showUserService;
     _addUserService    = addUserService;
     _updateUserService = updateUserService;
     _deleteUserService = deleteUserService;
 }
Beispiel #8
0
        public IActionResult Register(AddUserBindingModel model, HttpResponse response)
        {
            var service = new AddUserService();

            if (service.ValidateUser(model))
            {
                service.AddUser(model);
                Redirect(response, "/home/index");
                return(null);
            }
            return(this.View());
        }
        public bool AddUser(User user)
        {
            string hash = user.HashCode;

            string input = Hashhelper.GetProperty(user);

            if (Hashhelper.VerifyMd5Hash(input, hash))
            {
                AddUserService us    = new AddUserService();
                bool           state = us.AddUser(user);
                return(state);
            }
            return(false);
        }
        public async Task AddUserNoTrowException()
        {
            UserDto userToAdd = new UserDto
            {
                Name      = "Nombre de prueba",
                BirthDate = new DateTime(1945, 5, 6)
            };

            _uow.Stub(x => x.CommitAsync()).Return();
            _addUserLogic.Stub(x => x.ValidationsToAdd(null, userToAdd)).IgnoreArguments();
            _userRepository.Stub(x => x.Add(null)).IgnoreArguments();

            IAddUserService addUserService = new AddUserService(_uow, _userRepository, _addUserLogic);
            await addUserService.AddUser(userToAdd);
        }
        public IEnumerable <spSearch_Result> Search([FromBody] Test test)
        {
            string hash  = test.HashCode;
            string input = Hashhelper.GetProperty(test);

            if (Hashhelper.VerifyMd5Hash(input, hash))
            {
                AddUserService us    = new AddUserService();
                var            state = us.Search(test);
                log.DebugFormat("WebApi got letter {0}.", test.Letter);
                return(state);
            }
            else
            {
                return(null);
            }
        }
 public UsersAdd(User user = null)
 {
     InitializeComponent();
     DataContext = new AddUserService(user);
 }
 public CreateNewUserUseCase(AddUserService addUserService)
 {
     this.addUserService = addUserService;
 }