36 lines
1.4 KiB
C#
36 lines
1.4 KiB
C#
|
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");
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
}
|