Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasConstant committed Nov 16, 2021
1 parent 5014d7a commit 1855830
Showing 1 changed file with 31 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using BirdsiteLive.Common.Settings;
using BirdsiteLive.DAL.Contracts;
using BirdsiteLive.DAL.Models;
using BirdsiteLive.Moderation.Actions;
Expand Down Expand Up @@ -35,6 +36,11 @@ public async Task ProcessAsync_Test()
Id = userId2
}
};

var settings = new InstanceSettings
{
FailingTwitterUserCleanUpThreshold = 300
};
#endregion

#region Mocks
Expand All @@ -50,7 +56,7 @@ public async Task ProcessAsync_Test()
var removeTwitterAccountActionMock = new Mock<IRemoveTwitterAccountAction>(MockBehavior.Strict);
#endregion

var processor = new RefreshTwitterUserStatusProcessor(twitterUserServiceMock.Object, twitterUserDalMock.Object, removeTwitterAccountActionMock.Object);
var processor = new RefreshTwitterUserStatusProcessor(twitterUserServiceMock.Object, twitterUserDalMock.Object, removeTwitterAccountActionMock.Object, settings);
var result = await processor.ProcessAsync(users.ToArray(), CancellationToken.None);

#region Validations
Expand Down Expand Up @@ -78,6 +84,11 @@ public async Task ProcessAsync_ResetErrorCount_Test()
FetchingErrorCount = 100
}
};

var settings = new InstanceSettings
{
FailingTwitterUserCleanUpThreshold = 300
};
#endregion

#region Mocks
Expand All @@ -93,7 +104,7 @@ public async Task ProcessAsync_ResetErrorCount_Test()
var removeTwitterAccountActionMock = new Mock<IRemoveTwitterAccountAction>(MockBehavior.Strict);
#endregion

var processor = new RefreshTwitterUserStatusProcessor(twitterUserServiceMock.Object, twitterUserDalMock.Object, removeTwitterAccountActionMock.Object);
var processor = new RefreshTwitterUserStatusProcessor(twitterUserServiceMock.Object, twitterUserDalMock.Object, removeTwitterAccountActionMock.Object, settings);
var result = await processor.ProcessAsync(users.ToArray(), CancellationToken.None);

#region Validations
Expand Down Expand Up @@ -130,6 +141,11 @@ public async Task ProcessAsync_Unfound_Test()
Acct = acct2
}
};

var settings = new InstanceSettings
{
FailingTwitterUserCleanUpThreshold = 300
};
#endregion

#region Mocks
Expand Down Expand Up @@ -164,7 +180,7 @@ public async Task ProcessAsync_Unfound_Test()
var removeTwitterAccountActionMock = new Mock<IRemoveTwitterAccountAction>(MockBehavior.Strict);
#endregion

var processor = new RefreshTwitterUserStatusProcessor(twitterUserServiceMock.Object, twitterUserDalMock.Object, removeTwitterAccountActionMock.Object);
var processor = new RefreshTwitterUserStatusProcessor(twitterUserServiceMock.Object, twitterUserDalMock.Object, removeTwitterAccountActionMock.Object, settings);
var result = await processor.ProcessAsync(users.ToArray(), CancellationToken.None);

#region Validations
Expand Down Expand Up @@ -200,6 +216,11 @@ public async Task ProcessAsync_Unfound_OverThreshold_Test()
Acct = acct2
}
};

var settings = new InstanceSettings
{
FailingTwitterUserCleanUpThreshold = 300
};
#endregion

#region Mocks
Expand Down Expand Up @@ -233,7 +254,7 @@ public async Task ProcessAsync_Unfound_OverThreshold_Test()
.Returns(Task.CompletedTask);
#endregion

var processor = new RefreshTwitterUserStatusProcessor(twitterUserServiceMock.Object, twitterUserDalMock.Object, removeTwitterAccountActionMock.Object);
var processor = new RefreshTwitterUserStatusProcessor(twitterUserServiceMock.Object, twitterUserDalMock.Object, removeTwitterAccountActionMock.Object, settings);
var result = await processor.ProcessAsync(users.ToArray(), CancellationToken.None);

#region Validations
Expand Down Expand Up @@ -269,6 +290,11 @@ public async Task ProcessAsync_Protected_Test()
Acct = acct2
}
};

var settings = new InstanceSettings
{
FailingTwitterUserCleanUpThreshold = 300
};
#endregion

#region Mocks
Expand All @@ -291,7 +317,7 @@ public async Task ProcessAsync_Protected_Test()
var removeTwitterAccountActionMock = new Mock<IRemoveTwitterAccountAction>(MockBehavior.Strict);
#endregion

var processor = new RefreshTwitterUserStatusProcessor(twitterUserServiceMock.Object, twitterUserDalMock.Object, removeTwitterAccountActionMock.Object);
var processor = new RefreshTwitterUserStatusProcessor(twitterUserServiceMock.Object, twitterUserDalMock.Object, removeTwitterAccountActionMock.Object, settings);
var result = await processor.ProcessAsync(users.ToArray(), CancellationToken.None);

#region Validations
Expand Down

0 comments on commit 1855830

Please sign in to comment.