Пример #1
0
 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);
     }
 }
Пример #2
0
        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);
            }
        }
Пример #3
0
        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);
        }