-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #99
- Loading branch information
Showing
8 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ | |
"Service": "LinkAce", | ||
"ApiToken": "", | ||
"LinkAceUri": "" | ||
} | ||
}, | ||
"IgnoredAccounts": [] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using BookmarkSync.Core.Entities; | ||
|
||
namespace BookmarkSync.Core.Extensions; | ||
|
||
public static class ListExtensions | ||
{ | ||
public static List<Bookmark>? RemoveAllFromIgnoredAccounts( | ||
this List<Bookmark>? bookmarks, | ||
List<string> ignoredAccounts) | ||
{ | ||
if (bookmarks is null) return bookmarks; | ||
bookmarks.RemoveAll(b => ignoredAccounts.Contains(b.Account.Name)); | ||
Check warning on line 12 in src/BookmarkSync.Core/Extensions/ListExtensions.cs GitHub Actions / build
|
||
return bookmarks; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,28 @@ namespace BookmarkSync.Core.Tests.Extensions; | |
[TestClass] | ||
public class StringExtensionsTests | ||
{ | ||
[DataTestMethod] | ||
[DataRow("@prplecake", true)] | ||
[DataRow("flipper", false)] | ||
public void HasLeadingAt_Success(string input, bool expected) | ||
{ | ||
// Act | ||
var actual = input.HasLeadingAt(); | ||
|
||
// Assert | ||
Assert.AreEqual(expected, actual); | ||
} | ||
[DataTestMethod] | ||
[DataRow("@[email protected]", "[email protected]")] | ||
[DataRow("[email protected]", "[email protected]")] | ||
public void RemoveLeadingAt_Success(string input, string expected) | ||
{ | ||
// Act | ||
var actual = input.RemoveLeadingAt(); | ||
|
||
// Assert | ||
Assert.AreEqual(expected, actual); | ||
} | ||
[DataTestMethod] | ||
[DataRow("Example", "example")] | ||
[DataRow("TestCase", "test_case")] | ||
|