public void DictiionaryBasedWordStructure_InitialiseWithFileString_CheckThatHasLoadedWords()
 {
     var sut = new InMemoryHashBasedWordStructure();
     sut.AddSynonyms("oneWord", new string[] { " OneWordSyn", " OneWordSynTwo" });
     sut.AddSynonyms("twoWord", new string[] { "TwoWordSyn" });
     sut.AddSynonyms("threeWord", new string[] { "threeWodSyn", "threeWodSyn", " fourWord" });
     sut.AddSynonyms("fourWord", new string[] { " OneWordSyn" });
     var existingKeywordSynonyms = sut.GetSynonyms("threeWord");
     Assert.That(existingKeywordSynonyms, Is.Not.Null);
     Assert.True(Array.IndexOf(existingKeywordSynonyms.Select(k => k.Keyword).ToArray(), "threeWodSyn") >= 0, "Synonyms list should contain 'threeWodSyn' synonym form test set");
     var notExistingKeyword = sut.GetSynonyms("NotExistingKeywordsTestValue");
     Assert.That(notExistingKeyword, Is.Null);
 }
        public void InMemorySuggester_ReadSmallTestFileInMobyFormat_CheckFileReadingVerifyThatReadsAllStrings()
        {
            var storageMock = this.kernel.GetMock<IinMemoryStorageStructure>();

            var StorageStructure = new InMemoryHashBasedWordStructure();
            MobyToMemoryReader concreteReader = new MobyToMemoryReader();
            var sut = new InMemorySuggester(StorageStructure, concreteReader, SmallMobyTestDataFileName);

            var s1 = sut.GetSuggestions(new SimpleStringObject("oneWord"));
            var s2 = sut.GetSuggestions(new SimpleStringObject("twoWord"));
            var s3 = sut.GetSuggestions(new SimpleStringObject("threeWord"));
            var s4 = sut.GetSuggestions(new SimpleStringObject("fourWord"));

            CollectionAssert.AreEqual(s1.Select(s => s.Value.GetLiteralValue()).ToArray(), new string[] { "OneWordSyn", "OneWordSynTWO" });
            CollectionAssert.AreEqual(s2.Select(s => s.Value.GetLiteralValue()).ToArray(), new string[] { "TwoWordSyn" });
            CollectionAssert.AreEqual(s3.Select(s => s.Value.GetLiteralValue()).ToArray(), new string[] { "threeWodSyn", "fourWord" });
            CollectionAssert.AreEqual(s4.Select(s => s.Value.GetLiteralValue()).ToArray(), new string[] { "OneWordSyn" });
        }
 public void InMemorySuggester_LoadRealLifeSizedDataToDictionaryBasedStructureWithMobyToMemoryWITHNOTESTS_TestPefomanceTest()
 {
     // 10 second for all possibly synonyms. Without validation was about 4 or 5 with kernel
     // Try to make faster.
     InMemoryHashBasedWordStructure storage = new InMemoryHashBasedWordStructure();
     var testLargeSizeFileName = LargeFileWithMobyTestDataFileName;
     var MobyToMemory = new MobyToMemoryReader(false);
     var sut = new InMemorySuggester(storage, MobyToMemory, testLargeSizeFileName);
 }
        public void InMemorySuggester_LoadRealLifeSizedDataToDictionaryBasedStructureWithRipictsToMemory50file_TestPefomanceTest()
        {
            // 4 second for all possibly synonyms. With ninject ma be 5.
            // Try to make faster.
            InMemoryHashBasedWordStructure storage = new InMemoryHashBasedWordStructure();

            var RipictsToMemory = new RipictsSynsToMemoryReader();
            var sut = new InMemorySuggester(storage, RipictsToMemory, Large50FileWithRipictsTestDataFileName);
        }