public async Task LargeTextQuickResult()
 {
     // tests against large text string
     await CustomEntitySearchHelpers.CallEntitySearchFunctionAndCheckResults(
         TestData.LargeTextOutputFound, TestData.LargeTextOutputNames, TestData.LargeTextOutputMatchIndex,
         TestData.LargestText, TestData.LargeTextQuickResultInputWords);
 }
 public async Task EmptyTextWordsNotFound()
 {
     // tests against empty string text
     await CustomEntitySearchHelpers.CallEntitySearchFunctionAndCheckResults(
         Array.Empty <string>(), Array.Empty <string>(), Array.Empty <int>(),
         "", TestData.EmptyTextWordsNotFoundInput);
 }
 public async Task EmptyWordsEmptyEntities()
 {
     //tests against empty string words
     await CustomEntitySearchHelpers.CallEntitySearchFunctionAndCheckResults(
         Array.Empty <string>(), Array.Empty <string>(), Array.Empty <int>(),
         "", Array.Empty <string>(), "", TestData.EmptyWordsEmptyEntitiesErrorMessage);
 }
 public async Task LargeNumWordsQuickResult()
 {
     // tests against a large number of patterns in words array
     await CustomEntitySearchHelpers.CallEntitySearchFunctionAndCheckResults(
         TestData.LargeNumWordsOutputFound, TestData.LargeNumWordsOutputNames, TestData.LargeNumWordsOutputMatchIndex,
         TestData.LargestText, TestData.LargestWords);
 }
        public async Task MissingTextBadRequest()
        {
            // tests against incorrect input (missing text)
            WebApiSkillResponse outputContent = await CustomEntitySearchHelpers.QueryEntitySearchFunction(TestData.MissingTextBadRequestInput);

            Assert.IsTrue(outputContent.Values[0].Errors[0].Message.Contains(TestData.MissingTextExpectedResponse));
        }
        public async Task LargeDatasetQuickResult()
        {
            //tests against a large number of documents inputted (loadtest)
            await CustomEntitySearchHelpers.CallEntitySearchFunctionAndCheckResults(
                TestData.LargeTextOutputFound, TestData.LargeTextOutputNames, TestData.LargeTextOutputMatchIndex,
                TestData.LargestText, TestData.LargeTextQuickResultInputWords);

            // TestData.NumDocs 2300
        }
        public async Task SupportAllOtherCurrentLanguages()
        {
            TestData.supportedTextandWordsTempInitializer();
            Dictionary <string, string[]> supportedLangTextandWords = TestData.supportedTextandWords;
            Dictionary <string, int[]>    matchIndices = TestData.supportedMatchIndices;

            foreach (string language in supportedLangTextandWords.Keys)
            {
                await CustomEntitySearchHelpers.CallEntitySearchFunctionAndCheckResults(
                    new string[] { supportedLangTextandWords[language][3] }, supportedLangTextandWords[language][2].Split(", "),
                    matchIndices[language], supportedLangTextandWords[language][0], new string[] { supportedLangTextandWords[language][1] });
            }
        }
        public async Task CheckFuzzySituationAllLang()
        {
            if (!TestData.supportedTextandWords.ContainsKey("Greek"))
            {
                TestData.supportedTextandWordsTempInitializer();
            }
            Dictionary <string, string[]> supportedLangTextandWords = TestData.supportedTextandWords;
            Dictionary <string, int[]>    matchIndices    = TestData.supportedMatchIndices;
            Dictionary <string, double[]> confidenceScore = TestData.supportedConfidence;

            foreach (string language in confidenceScore.Keys)
            {
                await CustomEntitySearchHelpers.CallEntitySearchFunctionAndCheckResults(
                    new string[] { supportedLangTextandWords[language][4] }, supportedLangTextandWords[language][2].Split(", "),
                    matchIndices[language], confidenceScore[language], supportedLangTextandWords[language][0],
                    new string[] { supportedLangTextandWords[language][4] }, new Dictionary <string, string[]>(), Array.Empty <string>(), 1);
            }
        }
 public async Task OverlapInText()
 {
     await CustomEntitySearchHelpers.CallEntitySearchFunctionAndCheckResults(TestData.OverlapInTextWords, TestData.OverlapInTextMatches,
                                                                             TestData.OverlapInTextIndices, TestData.OverlapInTextConfidence, TestData.OverlapInTextText,
                                                                             TestData.OverlapInTextWords, new Dictionary <string, string[]>(), Array.Empty <string>(), 1);
 }
 public async Task AccentsHalfMismatch()
 {
     await CustomEntitySearchHelpers.CallEntitySearchFunctionAndCheckResults(TestData.AccentsHalfMismatchWords,
                                                                             new string[] { TestData.AccentsHalfMismatchText }, new int[] { 0 }, new double[] { 0.5 }, TestData.AccentsHalfMismatchText,
                                                                             TestData.AccentsHalfMismatchWords, new Dictionary <string, string[]>(), Array.Empty <string>(), 1);
 }
 public async Task LargeLeniencyMismatchedMix()
 {
     await CustomEntitySearchHelpers.CallEntitySearchFunctionAndCheckResults(TestData.LargeLeniencyMismatchedMixWords, TestData.LargeLeniencyMismatchedMixMatches,
                                                                             TestData.LargeLeniencyMismatchedMixIndices, TestData.LargeLeniencyMismatchedMixConfidence, TestData.LargeLeniencyMismatchedMixText,
                                                                             TestData.LargeLeniencyMismatchedMixWords, new Dictionary <string, string[]>(), Array.Empty <string>(), 3);
 }
        public async Task WordSmallerThanLeniency()
        {
            WebApiSkillResponse outputContent = await CustomEntitySearchHelpers.QueryEntitySearchFunction(TestData.WordSmallerThanLeniencyInput);

            Assert.IsTrue(outputContent.Values[0].Warnings[0].Message.Contains(TestData.WordSmallerThanLeniencyWarning));
        }
 public async Task FuzzyTextLongerThanWords()
 {
     await CustomEntitySearchHelpers.CallEntitySearchFunctionAndCheckResults(TestData.FuzzyTextLongerThanWordsWords, TestData.FuzzyTextLongerThanWordsMatches,
                                                                             TestData.FuzzyTextLongerThanWordsIndices, TestData.FuzzyTextLongerThanWordsConfidence, TestData.FuzzyTextLongerThanWordsText,
                                                                             TestData.FuzzyTextLongerThanWordsWords, new Dictionary <string, string[]>(), Array.Empty <string>(), 1);
 }
 public async Task FuzzyWordsLongerThanText()
 {
     await CustomEntitySearchHelpers.CallEntitySearchFunctionAndCheckResults(TestData.FuzzyWordsLongerThanTextWords, new[] { TestData.FuzzyWordsLongerThanTextText },
                                                                             TestData.FuzzyWordsLongerThanTextIndices, TestData.FuzzyWordsLongerThanTextConfidence, TestData.FuzzyWordsLongerThanTextText,
                                                                             TestData.FuzzyWordsLongerThanTextWords, new Dictionary <string, string[]>(), Array.Empty <string>(), 1);
 }
 public async Task OnlyFindEntitiesUnderOffsetLimit()
 {
     await CustomEntitySearchHelpers.CallEntitySearchFunctionAndCheckResults(TestData.OnlyFindEntitiesUnderOffsetLimitWords, TestData.OnlyFindEntitiesUnderOffsetLimitMatches,
                                                                             TestData.OnlyFindEntitiesUnderOffsetLimitIndices, TestData.OnlyFindEntitiesUnderOffsetLimitConfidence, TestData.OnlyFindEntitiesUnderOffsetLimitText,
                                                                             TestData.OnlyFindEntitiesUnderOffsetLimitWords, new Dictionary <string, string[]>(), Array.Empty <string>(), 1);
 }
 public async Task LargestLeniencyCheck()
 {
     await CustomEntitySearchHelpers.CallEntitySearchFunctionAndCheckResults(TestData.LargestLeniencyCheckMatchesFound, TestData.LargestLeniencyCheckMatches,
                                                                             TestData.LargestLeniencyCheckIndices, TestData.LargestLeniencyCheckConfidence, TestData.LargestLeniencyCheckText,
                                                                             TestData.LargestLeniencyCheckWords, new Dictionary <string, string[]>(), Array.Empty <string>(), 10, TestData.LargestLeniencyCheckWarning);
 }
 public async Task NoDoubleCountedExactMatch()
 {
     await CustomEntitySearchHelpers.CallEntitySearchFunctionAndCheckResults(TestData.NoDoubleCountedExactMatchWords, TestData.NoDoubleCountedExactMatches,
                                                                             TestData.NoDoubleCountedExactMatchIndices, TestData.NoDoubleCountedExactMatchConfidence, TestData.NoDoubleCountedExactMatchText,
                                                                             TestData.NoDoubleCountedExactMatchWords, new Dictionary <string, string[]>(), Array.Empty <string>(), 1);
 }