Пример #1
0
        public void RemovingGlossFromEmptyEntry_RemovesEntry()
        {
            RecordToken <LexEntry> token = PrepareEntryWithOneMeaning();

            //now simulate removing it, as when the user wants to correct spelling
            Task.TryToRemoveAssociationWithListWordFromEntry(token);
            Assert.AreEqual(0,
                            _lexEntryRepository.GetEntriesWithMatchingLexicalForm("uno", VernWs).
                            Count);
            Task.Deactivate();
        }
Пример #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();
        }
Пример #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();
        }