chore: dedupe faction id constants in gate operation tests
parent
39805ef8e6
commit
58a188eac0
|
|
@ -12,6 +12,7 @@ public sealed class FactionGateOperationsTests
|
|||
{
|
||||
private const string PlayerId = "dev-local-1";
|
||||
private const string GridFactionId = PrototypeE7M3QuestFactionRules.GridContractGateFactionId;
|
||||
private const string RustCollectiveFactionId = "prototype_faction_rust_collective";
|
||||
private const int GridMinStanding = PrototypeE7M3QuestFactionRules.GridContractMinStanding;
|
||||
|
||||
[Fact]
|
||||
|
|
@ -63,19 +64,18 @@ public sealed class FactionGateOperationsTests
|
|||
{
|
||||
// Arrange
|
||||
var standingStore = CreateStandingStore();
|
||||
const string rustFactionId = "prototype_faction_rust_collective";
|
||||
Assert.True(standingStore.TryApplyStandingDelta(PlayerId, GridFactionId, GridMinStanding).Success);
|
||||
var rules = new[]
|
||||
{
|
||||
new FactionGateRuleRow(GridFactionId, GridMinStanding),
|
||||
new FactionGateRuleRow(rustFactionId, 1),
|
||||
new FactionGateRuleRow(RustCollectiveFactionId, 1),
|
||||
};
|
||||
// Act
|
||||
var outcome = FactionGateOperations.TryEvaluate(PlayerId, rules, standingStore);
|
||||
// Assert
|
||||
Assert.False(outcome.Success);
|
||||
Assert.Equal(FactionGateEvaluateReasonCodes.GateBlocked, outcome.ReasonCode);
|
||||
Assert.Equal(rustFactionId, outcome.FailingFactionId);
|
||||
Assert.Equal(RustCollectiveFactionId, outcome.FailingFactionId);
|
||||
Assert.Equal(1, outcome.RequiredMinStanding);
|
||||
Assert.Equal(0, outcome.CurrentStanding);
|
||||
}
|
||||
|
|
@ -120,12 +120,10 @@ public sealed class FactionGateOperationsTests
|
|||
|
||||
private static FactionDefinitionRegistry CreatePrototypeRegistry()
|
||||
{
|
||||
var gridFactionId = PrototypeE7M3QuestFactionRules.GridContractGateFactionId;
|
||||
var rustFactionId = "prototype_faction_rust_collective";
|
||||
var byId = new Dictionary<string, FactionDefRow>(StringComparer.Ordinal)
|
||||
{
|
||||
[gridFactionId] = PrototypeE7M3FactionCatalogRules.ExpectedFactionFreeze[gridFactionId],
|
||||
[rustFactionId] = PrototypeE7M3FactionCatalogRules.ExpectedFactionFreeze[rustFactionId],
|
||||
[GridFactionId] = PrototypeE7M3FactionCatalogRules.ExpectedFactionFreeze[GridFactionId],
|
||||
[RustCollectiveFactionId] = PrototypeE7M3FactionCatalogRules.ExpectedFactionFreeze[RustCollectiveFactionId],
|
||||
};
|
||||
var catalog = new FactionDefinitionCatalog("/tmp/catalog", byId, catalogJsonFileCount: 1);
|
||||
return new FactionDefinitionRegistry(catalog);
|
||||
|
|
|
|||
Loading…
Reference in New Issue