Esempio n. 1
0
        public void DeveBuscarUsuario()
        {
            var json = ApiClient <User> .Request(Hooks.GetUsersEndpoint() + Hooks.GetUserId());

            json.Nome.Should().Be(UsuarioProvider.Nome());
            json.Email.Should().Be(UsuarioProvider.Email());
            json.Password.Should().Be(UsuarioProvider.Password());
            json.Administrador.Should().Be(UsuarioProvider.Administrador());
            json.Id.Should().NotBeNull();
        }
Esempio n. 2
0
        public void NaoDeveCriarUmUsuarioComEmailJaUtilizado()
        {
            JObject jObjectBody = new JObject();

            jObjectBody.Add("nome", UsuarioProvider.Nome());
            jObjectBody.Add("email", UsuarioProvider.Email());
            jObjectBody.Add("password", UsuarioProvider.Password());
            jObjectBody.Add("administrador", UsuarioProvider.Administrador());

            var json = ApiClient <User> .Request(Hooks.GetUsersEndpoint(), Method.POST, jObjectBody);

            LastUserId = json.Id;
            json.Message.Should().Be(MessageProvider.EmailJaCadastrado());
        }
Esempio n. 3
0
        public void DeveCriarUmUsuario()
        {
            JObject jObjectBody = new JObject();

            jObjectBody.Add("nome", "Tomas Oliver");
            jObjectBody.Add("email", "*****@*****.**");
            jObjectBody.Add("password", "123456");
            jObjectBody.Add("administrador", "true");

            var json = ApiClient <User> .Request(Hooks.GetUsersEndpoint(), Method.POST, jObjectBody);

            LastUserId = json.Id;
            json.Message.Should().Be(MessageProvider.CadastroDeUsuarioComSucesso());
            json.Id.Should().NotBeNull();
        }
Esempio n. 4
0
        public void NaoDeveBuscarUsuario()
        {
            var json = ApiClient <User> .Request(Hooks.GetUsersEndpoint() + "/123");

            json.Message.Should().Be(MessageProvider.UsuarioNaoEncontrado());
        }
Esempio n. 5
0
        public void DeveExcluirUsuarioExistente()
        {
            string endpoint = Hooks.GetUsersEndpoint() + "/" + LastUserId;

            var json = ApiClient <User> .Request(endpoint, Method.DELETE);
        }