Пример #1
0
        public void CombinationOfParams(
            [Values("EUR", "UK 100")] string query,
            [Values("0", "90")] string tagId,
            [Values("true", "false")] string searchByMarketCode,
            [Values("true", "false")] string searchByMarketName,
            [Values("true", "false")] string spreadProductType,
            [Values("true", "false")] string cfdProductType,
            [Values("true", "false")] string binaryProductType,
            [Values("true", "false")] string includeOptions,
            [Values("1000")] string maxResults,
            [Values("true", "false")] string useMobileShortName)
        {
            var parametrs = new Dictionary <string, string>()
            {
                { "query", query },
                { "tagId", tagId },
                { "searchByMarketCode", searchByMarketCode },
                { "searchByMarketName", searchByMarketName },
                { "spreadProductType", spreadProductType },
                { "cfdProductType", cfdProductType },
                { "binaryProductType", binaryProductType },
                { "includeOptions", includeOptions },
                { "maxResults", maxResults },
                { "useMobileShortName", useMobileShortName }
            };

            //FullSearchWithTags
            var fullSearchWithTagsResponse = webConnection.GetFullSearchWithTagsResponse(parametrs);

            Assert.IsTrue(IsTagsExistInResponse(fullSearchWithTagsResponse),
                          "Error: Tags should exist in responseString " + fullSearchWithTagsResponse);
            var withTags = JsonConvert.DeserializeObject <ResponseWithTags>(fullSearchWithTagsResponse);

            //SearchWithoutTags
            var searchWithoutTagsResponse = webConnection.GetSearchWithoutTagsResponse(parametrs);

            Assert.IsFalse(IsTagsExistInResponse(searchWithoutTagsResponse),
                           "Error: Tags should not exist in responseString " + searchWithoutTagsResponse);
            var withoutTags = JsonConvert.DeserializeObject <ResponseWithoutTags>(searchWithoutTagsResponse);

            //Assert responses correct
            AssertResponses(withoutTags, withTags);
        }