Ejemplo n.º 1
0
        public async Task TestCreateGroup()
        {
            using (var client = new TestClientProvider().Client)
            {
                var response = await client.PostAsync("/api/faq/groups",
                                                      new StringContent(JsonConvert.SerializeObject("TestGroup"), Encoding.UTF8, "application/json"));

                response.EnsureSuccessStatusCode();
                response.StatusCode.Should().Be(HttpStatusCode.OK);
            }
        }
Ejemplo n.º 2
0
        public async Task TestCreateQuestion()
        {
            using (var client = new TestClientProvider().Client)
            {
                var response = await client.PostAsync("/api/faq/questions",
                                                      new StringContent(JsonConvert.SerializeObject(new FaqQuestionCreateUpdateVM
                {
                    Question = "TestQuestion",
                    Answer = "TestAnswer",
                    FaqGroupId = 1
                }),
                                                                        Encoding.UTF8,
                                                                        "application/json"));

                response.EnsureSuccessStatusCode();
                response.StatusCode.Should().Be(HttpStatusCode.OK);
            }
        }