コード例 #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();
            }
        }
コード例 #2
0
        public void ClickingAddWordIncreasesRecordsByOne()
        {
            AddInitialEntries();
            int before = _lexEntryRepository.CountAllItems();

            ClickAddWord();
            Assert.AreEqual(1 + before, _lexEntryRepository.CountAllItems());
        }
コード例 #3
0
        public void AddWordNotInDB()
        {
            Task.NavigateFirstToShow();
            Assert.AreEqual(0, _lexEntryRepository.CountAllItems());
            MultiText word = new MultiText();

            word[VernWs.Id] = "uno";
            Task.WordCollected(word);
            Assert.AreEqual(1, _lexEntryRepository.CountAllItems());

            //this is an attempt to get a failure that I was able to get at one time in the
            //app itself, but which I haven't got to fail under tests.  I believe I've
            //fixed the bug, but alas this never really demonstrated it.
            Assert.AreEqual(1, Task.GetRecordsWithMatchingMeaning().Count);
            Task.Deactivate();
        }
コード例 #4
0
ファイル: Dash.cs プロジェクト: sillsdev/wesay
        private void AddItemsToFlow()
        {
            _addedAllButtons = false;
            _title           = new DictionaryStatusControl(_lexEntryRepository.CountAllItems());
            _title.Font      = new Font(StringCatalog.LabelFont.FontFamily, 14);
            _title.BackColor = Color.Transparent;
            _title.ShowLogo  = true;
            _title.Width     = _panel.Width - _title.Margin.Left - _title.Margin.Right;
            _title.TabStop   = false;
            _buttonRows.Clear();
            _panel.Controls.Add(_title);


            foreach (ButtonGroup group in _buttonGroups)
            {
                AddButtonGroupToFlow(group);
            }
            _addedAllButtons = true;
        }
コード例 #5
0
//
//        public ViewTemplate ViewTemplate
//        {
//            get { return _viewTemplate; }
//        }

        protected override int ComputeCount(bool returnResultEvenIfExpensive)
        {
            return(LexEntryRepository.CountAllItems());
        }
コード例 #6
0
 protected override int ComputeReferenceCount()
 {
     //TODO: Make this correct for Examples.  Currently it counts all words which
     //gives an incorrect progress indicator when not all words have meanings
     return(LexEntryRepository.CountAllItems());
 }