added users count

This commit is contained in:
Nicolas Constant
2020-12-30 01:43:26 -05:00
parent 47649392ed
commit 4b05123bd3
7 changed files with 89 additions and 4 deletions

View File

@ -137,6 +137,43 @@ namespace BirdsiteLive.DAL.Postgres.Tests.DataAccessLayers
Assert.AreEqual(0, result.Length);
}
[TestMethod]
public async Task CountFollowersAsync()
{
var dal = new FollowersPostgresDal(_settings);
var result = await dal.GetFollowersCountAsync();
Assert.AreEqual(0, result);
//User 1
var acct = "myhandle1";
var host = "domain.ext";
var following = new[] { 1, 2, 3 };
var followingSync = new Dictionary<int, long>();
var inboxRoute = "/myhandle1/inbox";
var sharedInboxRoute = "/inbox";
await dal.CreateFollowerAsync(acct, host, inboxRoute, sharedInboxRoute, following, followingSync);
//User 2
acct = "myhandle2";
host = "domain.ext";
following = new[] { 2, 4, 5 };
inboxRoute = "/myhandle2/inbox";
sharedInboxRoute = "/inbox2";
await dal.CreateFollowerAsync(acct, host, inboxRoute, sharedInboxRoute, following, followingSync);
//User 2
acct = "myhandle3";
host = "domain.ext";
following = new[] { 1 };
inboxRoute = "/myhandle3/inbox";
sharedInboxRoute = "/inbox3";
await dal.CreateFollowerAsync(acct, host, inboxRoute, sharedInboxRoute, following, followingSync);
result = await dal.GetFollowersCountAsync();
Assert.AreEqual(3, result);
}
[TestMethod]
public async Task CreateUpdateAndGetFollower_Add()
{