Exemple #1
0
        public void WebApiGetQuestionsEndPointTest()
        {
            //Arrange
            var _client = new RestSharpHelper();

            _client.InitializeNewRequest("http://localhost:8080", "/api/questions");

            //Act
            var result = _client.GetStringContent();

            //Assert

            JObject o = JObject.Parse(result);

            o["QuestionnaireTitle"].ShouldBeEquivalentTo("Geography Questions");
            o["QuestionsText"][0].ShouldBeEquivalentTo("What is the capital of Cuba?");
            o["QuestionsText"][1].ShouldBeEquivalentTo("What is the capital of France?");
            o["QuestionsText"][2].ShouldBeEquivalentTo("What is the capital of Poland?");
            o["QuestionsText"][3].ShouldBeEquivalentTo("What is the capital of Germany?");
        }