Code Clenup
This commit is contained in:
@@ -2,20 +2,15 @@ namespace RpgRoller.Tests;
|
||||
|
||||
public sealed class ServiceRollHelperTests
|
||||
{
|
||||
private sealed class FixedDiceRoller : IDiceRoller
|
||||
private sealed class FixedDiceRoller(IEnumerable<int> values) : IDiceRoller
|
||||
{
|
||||
public FixedDiceRoller(IEnumerable<int> values)
|
||||
{
|
||||
m_Values = new(values);
|
||||
}
|
||||
|
||||
public int Roll(int sides)
|
||||
{
|
||||
var next = m_Values.Count > 0 ? m_Values.Dequeue() : 1;
|
||||
return Math.Clamp(next, 1, sides);
|
||||
}
|
||||
|
||||
private readonly Queue<int> m_Values;
|
||||
private readonly Queue<int> m_Values = new(values);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -88,7 +88,7 @@ public sealed class ServiceSkillGroupAndOwnershipTests
|
||||
var gmTransfer = ServiceTestSupport.GetValue(service.UpdateCharacter(gmSession, character.Id, "Transferred", campaign.Id, "receiver"));
|
||||
var receiver = service.GetUserBySession(receiverSession);
|
||||
Assert.NotNull(receiver);
|
||||
Assert.Equal(receiver!.Id, gmTransfer.OwnerUserId);
|
||||
Assert.Equal(receiver.Id, gmTransfer.OwnerUserId);
|
||||
|
||||
var previousOwnerMe = ServiceTestSupport.GetValue(service.GetMe(ownerSession));
|
||||
Assert.Null(previousOwnerMe.ActiveCharacterId);
|
||||
@@ -133,7 +133,7 @@ public sealed class ServiceSkillGroupAndOwnershipTests
|
||||
|
||||
var adminTwo = service.GetUserBySession(adminTwoSession);
|
||||
Assert.NotNull(adminTwo);
|
||||
_ = ServiceTestSupport.GetValue(service.UpdateUserRoles(gmSession, adminTwo!.Id, ["admin"]));
|
||||
_ = ServiceTestSupport.GetValue(service.UpdateUserRoles(gmSession, adminTwo.Id, ["admin"]));
|
||||
|
||||
var adminUnlink = ServiceTestSupport.GetValue(service.UpdateCharacter(adminTwoSession, character.Id, "Admin Unlink", null));
|
||||
Assert.Null(adminUnlink.CampaignId);
|
||||
|
||||
Reference in New Issue
Block a user