Пример #1
0
        public async Task GetFlavors()
        {
            var client   = new MenuProvider()._client;
            var response = await client.GetAsync("/api/v1/flavor/query");

            response.EnsureSuccessStatusCode();
            Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
        }
Пример #2
0
        public async Task CreatePortuguesa()
        {
            var entry = new FlavorView
            {
                Name  = "Portuguesa",
                Price = 45.00
            };
            var payload = System.Text.Json.JsonSerializer.Serialize(entry);
            var client  = new MenuProvider()._client;

            var response = await client.PostAsync("/api/v1/flavor/save", new StringContent(payload, Encoding.UTF8, "application/json"));

            response.EnsureSuccessStatusCode();
            Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
        }