コード例 #1
0
        private void RegisteUser(string cpf)
        {
            var user = new DataFake().GetUserModel(cpf);

            user.Cpf = cpf;
            _        = _userService.Register(user).Result;
            _contextFake.SaveChanges();
        }
コード例 #2
0
        public UserValidationTest()
        {
            var fakeContext             = new ContextFake().CreateContext();
            var userRepository          = (IUserRepository) new UserRepository(fakeContext);
            var configurationRepository = (IConfigurationRepository) new ConfigurationRepository(fakeContext);

            _userValidation = new UserValidation(userRepository, configurationRepository);
            _dataFake       = new DataFake();
        }
コード例 #3
0
        public AccountValidation()
        {
            _contextFake = new ContextFake().CreateContext();
            _dataFake    = new DataFake();

            _userRepository = new UserRepository(_contextFake);
            var accountRepository       = (IAccountRepository) new AccountRepository(_contextFake);
            var movementRepository      = (IMovementRepository) new MovementRepository(_contextFake);
            var configurationRepository = (IConfigurationRepository) new ConfigurationRepository(_contextFake);

            var     userValidation = new UserValidation(_userRepository, configurationRepository);
            var     sharedService  = new SharedService(_userRepository, accountRepository);
            IMapper mapper         = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap <UserModel, User>();
            }).CreateMapper();

            _movementService = new MovementService(movementRepository, sharedService);
            _accountService  = new AccountService(accountRepository, _movementService, sharedService);
            _userService     = new UserService(_userRepository, accountRepository, _movementService, mapper, userValidation);
        }