public void GetProfileWithCorrectData()
        {
            var name     = "Maurício Luís dos Santos";
            var email    = "*****@*****.**";
            var password = "******";
            var prefix   = "21";
            var number   = "31785826";

            var model = new SignUpModel()
            {
                nome      = name,
                email     = email,
                senha     = password,
                telefones = new List <TelphoneModel>()
                {
                    new TelphoneModel()
                    {
                        ddd    = prefix,
                        numero = number
                    }
                }
            };

            var factory = new UsersFactory(model);

            factory.Create();

            var profile = factory.GetProfile();

            Assert.Equal(name, profile.Name);
        }
        public RegisteredUserModel Register(SignUpModel model)
        {
            factory = new UsersFactory(model);
            factory.Create();
            user    = factory.GetUser();
            profile = factory.GetProfile();
            profile.SetUserId(user.Id);

            ValidateDuplicatedUser();
            GenerateUserToken();

            profileRepository.Insert(profile);
            usersRepository.Insert(user);

            return(GetRegisteredUserModel());
        }