Beispiel #1
0
        public void Activate_Refreshes()
        {
            MissingInfoTask task = (MissingInfoTask)_task;

            task.Activate();
            try
            {
                Assert.IsTrue(
                    ((MissingInfoControl)task.Control).EntryViewControl.RtfContentsOfPreviewForTests.Contains(_lexicalForm));

                Assert.AreEqual(1, _lexEntryRepository.CountAllItems());
            }
            finally
            {
                task.Deactivate();
            }
            _lexEntryRepository.CreateItem();              //REVIEW: So, connect the dots for me...  Why should creating an
            // item here make the list switch to that item after the Activate()? (JH)
            task.Activate();
            try
            {
                Assert.IsTrue(
                    ((MissingInfoControl)task.Control).EntryViewControl.DataSource.LexicalForm.
                    Empty);
                Assert.AreEqual(2, _lexEntryRepository.CountAllItems());
            }
            finally
            {
                task.Deactivate();
            }
        }
Beispiel #2
0
        public void Deactivate_NoCurrentEntry_DoesntCrash()
        {
            using (TempFile repoFile = new TempFile())
            {
                using (LexEntryRepository repo = new LexEntryRepository(repoFile.Path))
                {
                    //notice, no entries
                    MissingInfoTask task = CreateMissingInfoTask(repo,
                                                                 this._missingFieldName,
                                                                 _label,
                                                                 _longLabel,
                                                                 _description,
                                                                 _remainingCountText,
                                                                 _referenceCountText,
                                                                 _viewTemplate,
                                                                 _fieldsToShow, string.Empty);

                    Assert.AreEqual(0, task.ExactCount);
                    task.Activate();
                    task.Deactivate();
                }
            }
        }