Add live skill filtering and align tests with current campaign behavior

This commit is contained in:
2026-02-26 15:37:17 +01:00
parent 59fe453297
commit ba8141b336
8 changed files with 119 additions and 75 deletions

View File

@@ -46,7 +46,8 @@ public sealed class ServiceCampaignTests
var sessionToken = ServiceTestSupport.GetValue(service.Login("user", "Password123")).SessionToken;
var result = service.GetOwnCharacters(sessionToken);
Assert.False(result.Succeeded);
Assert.True(result.Succeeded);
Assert.Empty(ServiceTestSupport.GetValue(result));
}
[Fact]
@@ -71,7 +72,7 @@ public sealed class ServiceCampaignTests
}
[Fact]
public void GetCampaign_ForNonGm_ReturnsOnlyOwnedCharactersAndSkills()
public void GetCampaign_ForNonGmParticipant_ReturnsCampaignCharactersAndSkills()
{
using var harness = ServiceTestSupport.CreateHarness();
var service = harness.Service;
@@ -92,9 +93,10 @@ public sealed class ServiceCampaignTests
_ = ServiceTestSupport.GetValue(service.CreateSkill(otherSession, otherCharacter.Id, "Perception", "1D+2", 1, true));
var ownerView = ServiceTestSupport.GetValue(service.GetCampaign(ownerSession, campaign.Id));
Assert.Single(ownerView.Characters);
Assert.Equal(ownerCharacter.Id, ownerView.Characters[0].Id);
Assert.Single(ownerView.Skills);
Assert.Equal(ownerSkill.Id, ownerView.Skills[0].Id);
Assert.Equal(2, ownerView.Characters.Count);
Assert.Contains(ownerView.Characters, character => character.Id == ownerCharacter.Id);
Assert.Contains(ownerView.Characters, character => character.Id == otherCharacter.Id);
Assert.Equal(2, ownerView.Skills.Count);
Assert.Contains(ownerView.Skills, skill => skill.Id == ownerSkill.Id);
}
}
}