Beispiel #1
0
        internal Musician Create()
        {
            if (password != confirmation_password)
            {
                throw new ValidateException("Senhas não coincidem");
            }

            var retorno = musicianBusiness.Create(this);

            return(retorno);
        }
Beispiel #2
0
        public void Musician_Create()
        {
            Login();

            MusicianBusiness musicianBusiness = new MusicianBusiness();
            Musician         musician         = new Musician
            {
                name       = faker.Person.FullName,
                email      = faker.Person.Email.ToLower(),
                password   = faker.Internet.Password(),
                birth_date = faker.Date.Between(new DateTime(1925, 1, 1), new DateTime(1997, 12, 31))
            };

            var retorno = musicianBusiness.Create(musician);

            bool ok = retorno.id > 0;

            Assert.IsTrue(ok);
        }
Beispiel #3
0
        public void Login()
        {
            string name = "Teste User", email = "*****@*****.**", password = "******";

            MusicianBusiness musicianBusiness = new MusicianBusiness();
            Musician         musician = musicianBusiness.Login(email, password);

            if (musician == null)
            {
                musician = new Musician
                {
                    name     = name,
                    email    = email,
                    password = password
                };

                musician = musicianBusiness.Create(musician);
            }

            loggedUser = musician;
        }