示例#1
0
        public void TestAccessTokenPlumbing()
        {
            string TestAccessToken = "usertoken";

            PinboardManager mgr = new PinboardManager(typeof(PinboardRequestMock), TestAccessToken);
            PinboardRequestMock request = (PinboardRequestMock)mgr.RequestObject;

            Assert.IsTrue(request.AccessToken == TestAccessToken);
        }
 public PinboardViewModel(System.Windows.Threading.Dispatcher Dispatcher, string ApiToken)
 {
     System.Diagnostics.Debug.WriteLine("ApiToken ==> " + ApiToken); // TODO
     this.Dispatcher = Dispatcher;
     Pinboard = new PinboardManager(ApiToken);
     BookmarkList = new ObservableCollection<PinboardBookmark>();
     Pinboard.GetRecentBookmarks(30).ContinueWith((task) =>
     {
         Dispatcher.Invoke(() =>
         {
             List<PinboardBookmark> Bookmarks = task.Result;
             foreach (PinboardBookmark Bookmark in Bookmarks)
             {
                 System.Diagnostics.Debug.WriteLine("Adding bookmark ==> " + Bookmark.Title);
                 BookmarkList.Add(Bookmark);
             }
         });
     });
 }
示例#3
0
        public void TestUsernamePasswordPlumbing()
        {
            string TestUsername = "******";
            string TestPassword = "******";

            PinboardManager mgr = new PinboardManager(typeof(PinboardRequestMock), TestUsername, TestPassword);
            PinboardRequestMock request = (PinboardRequestMock)mgr.RequestObject;

            Assert.IsTrue(request.Username == TestUsername);
            Assert.IsTrue(request.Password == TestPassword);
        }
示例#4
0
 public void TestSetup()
 {
     Pinboard = new PinboardManager(typeof(PinboardRequestMock), "accesstoken1");
     RequestObject = (PinboardRequestMock)Pinboard.RequestObject;
 }