コード例 #1
0
        public async Task Test_Get()
        {
            using (var client = new ClientProvider().Client)
            {
                var response = await client.GetAsync("/v1/Feriado");

                response.EnsureSuccessStatusCode();

                Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            }
        }
コード例 #2
0
        public async Task Test_Post()
        {
            using (var client = new ClientProvider().Client)
            {
                var response = await client.PostAsync("/v1/Feriado", new StringContent(
                                                          JsonConvert.SerializeObject(new Feriado()
                {
                    FeriadoId = 0,
                    FeriadoNome = "Teste Feriado",
                    DataFeriado = DateTime.Now,
                    TipoFeriadoId = 2
                })
                                                          , Encoding.UTF8, "application/json"));

                response.EnsureSuccessStatusCode();

                Assert.Equal(HttpStatusCode.OK, response.StatusCode);
            }
        }