public PinboardRequestMock() { ReferenceBookmark = new PinboardBookmark("http://www.test.com/", "This is the title"); ReferenceBookmark.Description = "This is the description"; ReferenceBookmark.AddTag("tag1"); ReferenceBookmark.AddTag("tag2"); ReferenceBookmark.CreationTime = ReferenceDate; ReferenceBookmark.Shared = true; ReferenceBookmark.ToRead = false; ReferencePostDates = new List<PinboardPostDate>(); ReferencePostDates.Add(new PinboardPostDate("1977-08-10", 7)); ReferencePostDates.Add(new PinboardPostDate("1982-02-10", 1)); ReferenceSuggestedTags = new PinboardSuggestedTags("http://www.sun.com/"); ReferenceSuggestedTags.popular = new string[] { "hardware" }; ReferenceSuggestedTags.recommended = new string[] { "sun", "solaris", "Hardware", "java", "Bookmarks_bar", "computer", "Computer_Hardware", "Bookmarks_Menu", "ComputerHardware", "Software" }; ReferenceTags = new List<PinboardCountedTag>(); ReferenceTags.Add(new PinboardCountedTag("tag1", 7)); ReferenceTags.Add(new PinboardCountedTag("tag2", 11)); ReferenceTags.Add(new PinboardCountedTag("tag7", 41)); ReferenceNotes = new List<PinboardNote>(); ReferenceNotes.Add(new PinboardNote("Body 1", "ID#1", "skdfjsldf", "Title 1", 6, "1977-08-10", "1983-02-10")); ReferenceNotes.Add(new PinboardNote("Body 2", "ID#2", "skdfjsldf", "Title 2", 6, "1977-08-10", "1983-02-10")); ReferenceNotes.Add(new PinboardNote("Body 3", "ID#3", "skdfjsldf", "Title 3", 6, "1977-08-10", "1983-02-10")); }
public void TestTagsAreKeptSortedWhenAdding() { PinboardBookmark bookmark = new PinboardBookmark(TestBookmarkURL, "Title"); bookmark.AddTag("Tag3"); bookmark.AddTag("Tag2"); bookmark.AddTag("Tag1"); Assert.IsTrue(bookmark.TagString == "Tag1 Tag2 Tag3"); }
public void TestAddValidBookmark() { PinboardBookmark bookmark = new PinboardBookmark(TestBookmarkURL, "Test Title"); bookmark.Description = "Test Description"; bookmark.AddTag("test1"); bookmark.CreationTime = DateTime.Now; bookmark.Shared = true; bookmark.ToRead = false; bool b = Pinboard.AddBookmark(bookmark, true).Result; Assert.IsTrue(b); }