29 lines
1001 B
C#
29 lines
1001 B
C#
using PrivaPub.Api.Mastodon.Mappers;
|
|||
|
|
using PrivaPub.Models.Post;
|
||
|
|
|
||
|
|
namespace PrivaPub.Tests.Api
|
||
|
|
{
|
||
|
|
public class StatusContentTests
|
||
|
|
{
|
||
|
|
[Fact]
|
||
|
|
public void A_remote_article_shows_its_title_above_its_body() =>
|
||
|
|
Assert.Equal("<p><strong>Rain & sun</strong></p><p>body</p>", MastodonMapper.Content(new Post
|
||
|
|
{
|
||
|
|
IsFederatedCopy = true, ObjectType = "Article", Title = "Rain & sun", ContentHtml = "<p>body</p>"
|
||
|
|
}));
|
||
|
|
|
||
|
|
[Fact]
|
||
|
|
public void A_remote_note_keeps_its_content_alone() =>
|
||
|
|
Assert.Equal("<p>body</p>", MastodonMapper.Content(new Post
|
||
|
|
{
|
||
|
|
IsFederatedCopy = true, ObjectType = "Note", Title = "a poll choice", ContentHtml = "<p>body</p>"
|
||
|
|
}));
|
||
|
|
|
||
|
|
[Fact]
|
||
|
|
public void A_remote_event_without_a_body_shows_its_excerpt() =>
|
||
|
|
Assert.Equal("<p><strong>Meetup</strong></p><p>Saturday <10:00></p>", MastodonMapper.Content(new Post
|
||
|
|
{
|
||
|
|
IsFederatedCopy = true, ObjectType = "Event", Title = "Meetup", Excerpt = "Saturday <10:00>", ContentHtml = string.Empty
|
||
|
|
}));
|
||
|
|
}
|
||
|
|
}
|