Skip to content

Commit

Permalink
Merge pull request #32 from prplecake/default-tags
Browse files Browse the repository at this point in the history
  • Loading branch information
prplecake authored Mar 29, 2023
2 parents 8bd9867 + 761d481 commit 97e96c5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions BookmarkSync.Core.Tests/Entities/BookmarkTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ namespace BookmarkSync.Core.Tests.Entities;
public class BookmarkTests
{
[TestMethod]
public void App_HasProperties()
public void Bookmark_HasProperties()
{
// Arrange
Bookmark obj = new();

// Assert
Assert.AreEqual(5, obj.PropertyCount());
Assert.AreEqual(6, obj.PropertyCount());
Assert.IsTrue(obj.HasProperty("Account"));
Assert.IsTrue(obj.HasProperty("Content"));
Assert.IsTrue(obj.HasProperty("Id"));
Assert.IsTrue(obj.HasProperty("Uri"));
Assert.IsTrue(obj.HasProperty("Visibility"));
Assert.IsTrue(obj.HasProperty("DefaultTags"));
}
}
2 changes: 2 additions & 0 deletions BookmarkSync.Core/Entities/Bookmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ public string? Content
public string? Id { get; set; }
public string? Uri { get; set; }
public string? Visibility { get; set; }
public string DefaultTags =>
string.Join(" ", $"via:@{Account}", "via:mastodon-bookmark-sync");
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public async Task<HttpResponseMessage> Save(Bookmark bookmark)
{
query["extended"] = extended;
}
query["tags"] = string.Join(" ", $"via:@{bookmark.Account}", "via:mastodon-bookmark-sync");
query["tags"] = bookmark.DefaultTags;
builder.Query = query.ToString();
var requestUri = builder.ToString();
_logger.Debug("Request URI: {RequestUri}", requestUri);
Expand Down

0 comments on commit 97e96c5

Please sign in to comment.