-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
717f690
commit 32b53e0
Showing
3 changed files
with
28 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
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 |
---|---|---|
|
@@ -289,6 +289,32 @@ public void Extract_SingleMentionTag_Test() | |
#endregion | ||
} | ||
|
||
[TestMethod] | ||
public void Extract_SingleMentionTag_RT_Test() | ||
{ | ||
#region Stubs | ||
var message = $"[RT @mynickname]{Environment.NewLine}Bla!"; | ||
#endregion | ||
|
||
#region Mocks | ||
var logger = new Mock<ILogger<StatusExtractor>>(); | ||
#endregion | ||
|
||
var service = new StatusExtractor(_settings, logger.Object); | ||
var result = service.Extract(message); | ||
|
||
#region Validations | ||
logger.VerifyAll(); | ||
Assert.AreEqual(1, result.tags.Length); | ||
Assert.AreEqual("@[email protected]", result.tags.First().name); | ||
Assert.AreEqual("Mention", result.tags.First().type); | ||
Assert.AreEqual("https://domain.name/users/mynickname", result.tags.First().href); | ||
|
||
Assert.IsTrue(result.content.Contains("Bla!")); | ||
Assert.IsTrue(result.content.Contains(@"<span class=""h-card""><a href=""https://domain.name/@mynickname"" class=""u-url mention"">@<span>mynickname</span></a></span>")); | ||
#endregion | ||
} | ||
|
||
[TestMethod] | ||
public void Extract_SingleMentionTag_Dot_Test() | ||
{ | ||
|