Esempio n. 1
0
        public async Task Deve_Criar_Um_Usuario()
        {
            var model = UserMock.GetUserModel();

            var response = await this.Post("", model);

            Assert.True(response.IsSuccessStatusCode, response.StatusCode.ToString());
        }
Esempio n. 2
0
        public async Task Deve_Criar_Um_Usuario_BadRequest()
        {
            var model = UserMock.GetUserModel();

            model.Name = "";

            var response = await this.Post("", model);

            Assert.True(response.StatusCode == HttpStatusCode.BadRequest, response.StatusCode.ToString());
        }
Esempio n. 3
0
        public async Task <UserModel> CriarUsuarioRetornandoModel()
        {
            var model    = UserMock.GetUserModel();
            var response = await this.Post("", model);

            if (!response.IsSuccessStatusCode)
            {
                throw new Exception("Erro ao criar o usuario");
            }

            return(model);
        }
Esempio n. 4
0
        private async Task <Guid> CriarUsuario()
        {
            var model = UserMock.GetUserModel();

            var response = await this.Post("", model);

            if (!response.IsSuccessStatusCode)
            {
                throw new Exception("Erro ao criar o usuario");
            }
            return(JsonConvert.DeserializeObject <Guid>(await response.Content.ReadAsStringAsync()));
        }
Esempio n. 5
0
        private async Task <UserModel> CriarUsuarioNaoAdmin()
        {
            var model = UserMock.GetUserModel();

            model.Administrator = false;

            var response = await this.Post("", model);

            if (!response.IsSuccessStatusCode)
            {
                throw new Exception("Erro ao criar o usuario");
            }

            return(model);
        }