public Tracker() { try { Search = new NullSearch (); if (Bus.Session.NameHasOwner (BUS_NAME)) Search = Bus.Session.GetObject<ITrackerSearch> (BUS_NAME, new ObjectPath (OBJECT_PATH)); } catch (Exception e) { Log<Tracker>.Error ("Error aquiring Tracker dbus object: {0}", e.Message); Log<Tracker>.Debug (e.StackTrace); } }
public Tracker() { try { Search = new NullSearch(); if (Bus.Session.NameHasOwner(BUS_NAME)) { Search = Bus.Session.GetObject <ITrackerSearch> (BUS_NAME, new ObjectPath(OBJECT_PATH)); } } catch (Exception e) { Log <Tracker> .Error("Error aquiring Tracker dbus object: {0}", e.Message); Log <Tracker> .Debug(e.StackTrace); } }
public void Execute() { const string searchString = "Search String"; var fakedPromptItems = new ObservableCollection <ISearchablePromptItem>(new[] { new Mock <ISearchablePromptItem>().Object, new Mock <ISearchablePromptItem>().Object }); var fakeSearchablePromptValueCollection = new Mock <ISearchablePromptItemCollection>(); fakeSearchablePromptValueCollection.SetupGet(c => c.Enumeration).Returns(fakedPromptItems); var search = new NullSearch(searchString); var searchResults = search.Execute(fakeSearchablePromptValueCollection.Object); Assert.AreEqual(fakedPromptItems, searchResults); }