chore: init project
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using FluentAssertions;
|
||||
using InboxIntel.Infrastructure.Gmail;
|
||||
using Xunit;
|
||||
|
||||
namespace InboxIntel.UnitTests;
|
||||
|
||||
public class UnsubscribeExtractionTests
|
||||
{
|
||||
[Fact]
|
||||
public void Prefers_http_link()
|
||||
{
|
||||
var raw = "<mailto:unsub@x.com>, <https://x.com/unsub?id=42>";
|
||||
GmailMessageParser.ExtractUnsubscribeTarget(raw).Should().Be("https://x.com/unsub?id=42");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Falls_back_to_mailto()
|
||||
{
|
||||
var raw = "<mailto:unsubscribe@news.example.com>";
|
||||
GmailMessageParser.ExtractUnsubscribeTarget(raw).Should().Be("mailto:unsubscribe@news.example.com");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Null_when_absent()
|
||||
{
|
||||
GmailMessageParser.ExtractUnsubscribeTarget(null).Should().BeNull();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user