public void GotoEntry_EntryNotInList_Throws() { AddInitialEntries(); DictionaryControl control = (DictionaryControl)_task.Control; Assert.Throws <NavigationException>(() => control.GoToEntryWithId("bogus")); }
public void GotoUrl_SameAsCurrentUrl_Ok() { AddInitialEntries(); DictionaryControl control = (DictionaryControl)_task.Control; control.GoToUrl(control.CurrentUrl); }
public void GotoEntry_EntryInList_GoesToIt() { AddInitialEntries(); DictionaryControl control = (DictionaryControl)_task.Control; string idOfInitial = control.CurrentEntry.Id; GoToLexicalEntryUseFind("Secondary"); //go away from that one control.GoToEntryWithId(idOfInitial); Assert.AreEqual(idOfInitial, control.CurrentEntry.Id); }
/// <summary> /// /// </summary> /// <param name="obj"></param> /// <param name="dictControl"></param> private void FillDictionary(object obj, DictionaryControl dictControl) { if (obj is Dictionary <string, string> stringDictionary) { foreach (KeyValuePair <string, string> item in stringDictionary) { dictControl.AddItem(item.Key, item.Value); } } else if (obj is Dictionary <string, string[]> stringArrayDictionary) { foreach (KeyValuePair <string, string[]> item in stringArrayDictionary) { dictControl.AddItem(item.Key, string.Join(';', item.Value)); } } }
public override void Activate() { try { base.Activate(); _dictionaryControl = new DictionaryControl(LexEntryRepository, ViewTemplate); // Debug.Assert(_userSettings.Get("one", "0") == "1"); if(_userSettings !=null && _userSettings.Get("lastUrl", null)!=null) _dictionaryControl.GoToEntry(_userSettings.Get("lastUrl", null)); } catch (ConfigurationException) { IsActive = false; throw; } }
public void Construct_EmptyViewTemplate_NoCrash() { using ( DictionaryControl e = new DictionaryControl(_lexEntryRepository, new ViewTemplate())) { Assert.IsNotNull(e); } }
public override void Deactivate() { base.Deactivate(); _dictionaryControl.Dispose(); _dictionaryControl = null; }