Esempio n. 1
0
		public void MissingWordListFileGivesMessage()
		{
			GatherWordListTask g = new GatherWordListTask(
				   GatherWordListConfig.CreateForTests("NotThere.txt",
						   WritingSystem.IdForUnknownAnalysis),
				   _lexEntryRepository,
				   new ViewTemplate());

			 g.Activate(); //should give a box to user, an exception in this text environment
		}
Esempio n. 2
0
        public void Ctor_EmptyTemplate_DoesntCrash()
        {
            GatherWordListTask g = new GatherWordListTask(
                GatherWordListConfig.CreateForTests(_simpleWordListFilePath,
                                                    WritingSystemsIdsForTests.AnalysisIdForTest, _catalog),
                _lexEntryRepository,
                _viewTemplate, new TaskMemoryRepository());

            g.Activate();
            Assert.IsNotNull(g);
            g.Deactivate();
        }
Esempio n. 3
0
        public void Activate_MissingWordListFile_GivesMessage()
        {
            GatherWordListTask g = new GatherWordListTask(
                GatherWordListConfig.CreateForTests("NotThere.txt",
                                                    WritingSystemsIdsForTests.AnalysisIdForTest, new WordListCatalog()),
                _lexEntryRepository,
                _viewTemplate, new TaskMemoryRepository());

            // the code doesn't show the errror box in release builds, but
            // the builder publishing configuration does run tests in release builds
            using (new Palaso.Reporting.ErrorReport.NonFatalErrorReportExpected())
            {
                g.Activate();
            }
            g.Deactivate();
        }
Esempio n. 4
0
        private GatherWordListTask CreateAndActivateLiftTask(IEnumerable <string> definitionWritingSystems, string entriesXml)
        {
            var file = new TempLiftFile("wordlist.lift", _tempFolder, entriesXml, Palaso.Lift.Validation.Validator.LiftVersion);

            var vt = new ViewTemplate();

            vt.Add(new Field(
                       Field.FieldNames.EntryLexicalForm.ToString(),
                       "LexEntry",
                       new[] { WritingSystemsIdsForTests.VernacularIdForTest }
                       ));
            vt.Add(new Field(
                       LexSense.WellKnownProperties.Definition.ToString(),
                       "LexSense", definitionWritingSystems
                       ));
            vt.Add(
                new Field(
                    LexSense.WellKnownProperties.Gloss.ToString(),
                    "LexSense",
                    new string[]
            {
                WritingSystemsIdsForTests.AnalysisIdForTest,
                "fr"
            }
                    )
                );

            var t = new GatherWordListTask(
                GatherWordListConfig.CreateForTests(file.Path, "xx", _catalog),
                _lexEntryRepository,
                vt,
                new TaskMemoryRepository()
                );

            t.Activate();
            return(t);
        }
Esempio n. 5
0
		public void WritingSystemNotInCurrentListGivesMessage()
		{
			GatherWordListTask g = new GatherWordListTask(
				GatherWordListConfig.CreateForTests(_wordListFilePath,
					"z7z"),
				_lexEntryRepository,
				_viewTemplate);

			g.Activate(); //should give a box to user, an exception in this text environment
		}