Write N1MM's own Contest table rows for the built-in contests
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Nonemm.Contests.Rules;
|
||||
using Nonemm.Contests.Udc;
|
||||
using Nonemm.Core;
|
||||
using Nonemm.Storage;
|
||||
|
||||
@@ -53,6 +54,40 @@ public class ContestDefinitionsTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ContestWithSeveralModesIsBoth() =>
|
||||
Assert.Equal("BOTH", ContestDefinitions.For(new IaruHf(), Germany).Mode);
|
||||
public void ContestWithSeveralModesIsBothAsN1mmWritesIt() =>
|
||||
Assert.Equal("Both", ContestDefinitions.For(new IaruHf(), Germany).Mode);
|
||||
|
||||
[Fact]
|
||||
public void ABuiltInContestTakesTheRowN1mmWrote()
|
||||
{
|
||||
ContestDefinition definition = ContestDefinitions.For(new Wae(ModeCategory.Cw), Germany);
|
||||
|
||||
Assert.Equal("DARC-WAEDC-CW", definition.CabrilloName);
|
||||
Assert.Equal("Worked All Europe - WAE CW", definition.DisplayName);
|
||||
Assert.Equal((3, 1, 1), (definition.DupeType, definition.Period, definition.PointsPerContact));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AUserDefinedContestIsWorkedOutFromItsFile()
|
||||
{
|
||||
UserDefinedContest contest = new(UdcFile.Parse("""
|
||||
[Contest]
|
||||
Name=SAMPLETEST
|
||||
DisplayName=Sample Test
|
||||
CabrilloName=SAMPLE-TEST
|
||||
Mode=CW
|
||||
DupeType=2
|
||||
Multiplier1Name=Countries
|
||||
MultSqlString=CountryPrefix
|
||||
IsMultPer=1
|
||||
PointsPerContact=1
|
||||
EntryWindowInfo=RCVText, 500, Exchange1Text, 500
|
||||
FrameText=RcvRST Exch
|
||||
DefaultContestExchange=599
|
||||
"""));
|
||||
|
||||
ContestDefinition definition = ContestDefinitions.For(contest, Germany);
|
||||
|
||||
Assert.Equal(("Sample Test", "SAMPLE-TEST", "Countries"), (definition.DisplayName, definition.CabrilloName, definition.Multiplier1Name));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user