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(); } }
public void ClickingAddWordIncreasesRecordsByOne() { AddInitialEntries(); int before = _lexEntryRepository.CountAllItems(); ClickAddWord(); Assert.AreEqual(1 + before, _lexEntryRepository.CountAllItems()); }
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(); }
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; }
// // public ViewTemplate ViewTemplate // { // get { return _viewTemplate; } // } protected override int ComputeCount(bool returnResultEvenIfExpensive) { return(LexEntryRepository.CountAllItems()); }
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()); }