コード例 #1
0
        public async Task Deve_Criar_Um_Projeto()
        {
            var model = ProjectMock.GetProjectModel();

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

            Assert.True(response.IsSuccessStatusCode, response.StatusCode.ToString());
        }
コード例 #2
0
        public async Task <Guid> CriarProjeto()
        {
            var model = ProjectMock.GetProjectModel();

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

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

            return(JsonConvert.DeserializeObject <Guid>(await response.Content.ReadAsStringAsync()));
        }
コード例 #3
0
        public async Task Deve_Alterar_Projeto()
        {
            var id = await this.CriarProjeto();

            var model = ProjectMock.GetProjectModel();

            model.Name = "Alterado - " + model.Name;

            var response = await this.Put(id.ToString(), model);

            string error = "";

            if (!response.IsSuccessStatusCode)
            {
                error = await response.Content.ReadAsStringAsync();
            }

            Assert.True(response.IsSuccessStatusCode, error);
        }