public void Setup()
        {
            WeSayProjectTestHelper.InitializeForTests();
            _glossingLanguageWSId   = WritingSystemsIdsForTests.AnalysisIdForTest;
            _vernacularLanguageWSId = WritingSystemsIdsForTests.VernacularIdForTest;
            BasilProject.Project.WritingSystems.Set(WritingSystemDefinition.Parse("fr"));

            _tempFolder             = new TemporaryFolder();
            _simpleWordListFilePath = _tempFolder.GetTemporaryFile();
//            _liftWordListFile = new TempLiftFile("wordlist.lift",_tempFolder, LiftXml, LiftIO.Validation.Validator.LiftVersion);
            _filePath = _tempFolder.GetTemporaryFile();

            _lexEntryRepository = new LexEntryRepository(_filePath);             // InMemoryRecordListManager();
            File.WriteAllLines(_simpleWordListFilePath, _words);
            _viewTemplate = new ViewTemplate();
            _viewTemplate.Add(new Field(Field.FieldNames.EntryLexicalForm.ToString(),
                                        "LexEntry",
                                        new string[]
            {
                WritingSystemsIdsForTests.VernacularIdForTest
            }));

            _viewTemplate.Add(
                new Field(
                    LexSense.WellKnownProperties.Definition.ToString(),
                    "LexSense",
                    new string[]
            {
                WritingSystemsIdsForTests.AnalysisIdForTest,
                "fr"
            }
                    )
                );

            _viewTemplate.Add(
                new Field(
                    LexSense.WellKnownProperties.Gloss.ToString(),
                    "LexSense",
                    new string[]
            {
                WritingSystemsIdsForTests.AnalysisIdForTest,
                "fr"
            }
                    )
                );
            _catalog = new WordListCatalog();
            _catalog.Add(_simpleWordListFilePath, new WordListDescription("en", "label", "longLabel", "description"));
            _task = new GatherWordListTask(GatherWordListConfig.CreateForTests(_simpleWordListFilePath, _glossingLanguageWSId, _catalog),
                                           _lexEntryRepository,
                                           _viewTemplate, new TaskMemoryRepository());
        }
Beispiel #2
0
		public GatherWordListConfig(string xml, WordListCatalog catalog)
			:base(xml)
		{
			_catalog = catalog;
		}
Beispiel #3
0
		public static IGatherWordListConfig CreateForTests(string wordListFileName, string wordListWritingSystemId)
		{
			string xml = String.Format(@"   <task taskName='AddMissingInfo' visible='true'>
					  <wordListFileName>{0}</wordListFileName>
					  <wordListWritingSystemId>{1}</wordListWritingSystemId>
					</task>
				", wordListFileName, wordListWritingSystemId);

			var catalog = new WordListCatalog();
			catalog.Add(wordListFileName, new WordListDescription(wordListWritingSystemId, "test", "test long", "pretend description"));
			return new GatherWordListConfig(xml, catalog);

		}
Beispiel #4
0
 public GatherWordListConfig(string xml, WordListCatalog catalog)
     : base(xml)
 {
     _catalog = catalog;
 }
Beispiel #5
0
        public static IGatherWordListConfig CreateForTests(string wordListFileName, string wordListWritingSystemId, WordListCatalog catalog)
        {
            string xml = String.Format(@"   <task taskName='AddMissingInfo' visible='true'>
					  <wordListFileName>{0}</wordListFileName>
					  <wordListWritingSystemId>{1}</wordListWritingSystemId>
					</task>
				"                , wordListFileName, wordListWritingSystemId);

            return(new GatherWordListConfig(xml, catalog));
        }
Beispiel #6
0
        public void CatalogGetOrAddWordList_NotContainedYet_JustAddsToCatalog()
        {
            var catalog = new WordListCatalog();

            Assert.IsNotNull(catalog.GetOrAddWordList("neverHeardOfMe.txt"));
        }