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 }
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(); }
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(); }
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); }
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 }