Пример #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());
        }
Пример #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());
        }
Пример #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);
        }
Пример #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()));
        }
Пример #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);
        }