Exemple #1
0
        public void GoogleCustomSearch_NoResult()
        {
            Boolean       assertion = false;
            List <string> origin    = new List <string>();

            origin.Add("ASDDDDDDDDDASDAAAAAAAAAAAAAAAAAAAasdaskffsafak");
            DocumentStatistics documentStatistics = new DocumentStatistics(origin);
            GoogleSearch       googleSearch       = new GoogleSearch(new Uri("https://www.googleapis.com/customsearch/v1"));

            googleSearch.Check(documentStatistics);
            if (documentStatistics.getPossiblePlagiates().Count == 0)
            {
                assertion = true;
            }
            Assert.True(assertion);
        }
Exemple #2
0
        public void GoogleCustomSearch_SourceFound()
        {
            Boolean       assertion = false;
            List <string> origin    = new List <string>();

            origin.Add("Platons Lehrer Sokrates disku­tiert mit dem berühm­ten Redner Gorgias von Leontinoi, nach dem der Dialog benannt ist, sowie dessen Schüler Polos und dem vorneh­men Athener Kallikles.");
            DocumentStatistics documentStatistics = new DocumentStatistics(origin);
            GoogleSearch       googleSearch       = new GoogleSearch(new Uri("https://www.googleapis.com/customsearch/v1"));

            googleSearch.Check(documentStatistics);
            foreach (Plagiat <String> source in documentStatistics.getPossiblePlagiates())
            {
                if (source.Source == "https://de.wikipedia.org/wiki/Gorgias_(Platon)")
                {
                    assertion = true;
                }
            }
            Assert.True(assertion);
        }