added timeline tests
This commit is contained in:
parent
999e0c2ba2
commit
759a697ce6
2 changed files with 37 additions and 0 deletions
|
@ -1,5 +1,7 @@
|
|||
# bird.makeup
|
||||
|
||||
[![builds.sr.ht status](https://builds.sr.ht/~cloutier/bird.makeup/commits/master/arch.yml.svg)](https://builds.sr.ht/~cloutier/bird.makeup/commits/master/arch.yml?)
|
||||
|
||||
## About
|
||||
|
||||
Bird.makeup is a way to follow twitter user from any ActivityPub service. The aim is to make tweets appear as native a possible to the fediverse, while being as scalable as possible. Unlike BirdsiteLive, bird.makeup doesn't use official twitter api, but the undocumented frontend api, just like nitter.net, which doesn't have rate limiting.
|
||||
|
|
35
src/Tests/BirdsiteLive.Twitter.Tests/TimelineTests.cs
Normal file
35
src/Tests/BirdsiteLive.Twitter.Tests/TimelineTests.cs
Normal file
|
@ -0,0 +1,35 @@
|
|||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Threading.Tasks;
|
||||
using BirdsiteLive.Twitter;
|
||||
using BirdsiteLive.Twitter.Tools;
|
||||
using BirdsiteLive.Statistics.Domain;
|
||||
using Moq;
|
||||
|
||||
namespace BirdsiteLive.ActivityPub.Tests
|
||||
{
|
||||
[TestClass]
|
||||
public class TimelineTests
|
||||
{
|
||||
private ITwitterTweetsService _tweetService;
|
||||
[TestInitialize]
|
||||
public async Task TestInit()
|
||||
{
|
||||
var logger1 = new Mock<ILogger<TwitterAuthenticationInitializer>>(MockBehavior.Strict);
|
||||
var logger2 = new Mock<ILogger<TwitterUserService>>(MockBehavior.Strict);
|
||||
var logger3 = new Mock<ILogger<TwitterTweetsService>>();
|
||||
var stats = new Mock<ITwitterStatisticsHandler>();
|
||||
ITwitterAuthenticationInitializer auth = new TwitterAuthenticationInitializer(logger1.Object);
|
||||
ITwitterUserService user = new TwitterUserService(auth, stats.Object, logger2.Object);
|
||||
_tweetService = new TwitterTweetsService(auth, stats.Object, user, logger3.Object);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public async Task TimelineKobe()
|
||||
{
|
||||
var tweets = await _tweetService.GetTimelineAsync("kobebryant", 100, 100000);
|
||||
Assert.AreEqual(tweets[0].MessageContent, "Continuing to move the game forward @KingJames. Much respect my brother 💪🏾 #33644");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in a new issue