Add the rest of the major contests, .udc files and the registry
ARRL DX, IARU HF, Sweepstakes, RTTY Roundup, NAQP and general logging join CQ WW and CQ WPX. The Cabrillo QSO line is now built column by column by the contest, because Sweepstakes puts the callsign after the serial number where everyone else puts it first. User-defined contests read the subset of N1MM's .udc settings that covers the exchange, the dupe rule, points and up to three multipliers. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
35
tests/Nonemm.Contests.Tests/SweepstakesTests.cs
Normal file
35
tests/Nonemm.Contests.Tests/SweepstakesTests.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using Nonemm.Contests.Rules;
|
||||
using Nonemm.Core;
|
||||
|
||||
namespace Nonemm.Contests.Tests;
|
||||
|
||||
public class SweepstakesTests
|
||||
{
|
||||
private static ContestLog Log() =>
|
||||
new(new Sweepstakes(ModeCategory.Cw), TestLog.UnitedStates, TestLog.CountryFile);
|
||||
|
||||
[Fact]
|
||||
public void EveryContactScoresTwo() =>
|
||||
Assert.Equal(2, Log().Judge(TestLog.Contact("K1ABC", section: "CT")).Points);
|
||||
|
||||
[Fact]
|
||||
public void AStationWorkedOnOneBandIsADupeOnEveryOther()
|
||||
{
|
||||
ContestLog log = Log();
|
||||
log.Add(TestLog.Contact("K1ABC", section: "CT"));
|
||||
Assert.True(log.Judge(TestLog.Contact("K1ABC", 7_025, section: "CT")).IsDupe);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SectionsCountOnceForTheWholeContest()
|
||||
{
|
||||
ContestLog log = Log();
|
||||
log.Add(TestLog.Contact("K1ABC", section: "CT"));
|
||||
Assert.Empty(log.Judge(TestLog.Contact("K2ABC", 7_025, section: "CT")).NewMultipliers);
|
||||
Assert.Single(log.Judge(TestLog.Contact("K2ABC", 7_025, section: "WMA")).NewMultipliers);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SomethingThatIsNotASectionCountsForNothing() =>
|
||||
Assert.Empty(Log().Judge(TestLog.Contact("K1ABC", section: "ZZ")).NewMultipliers);
|
||||
}
|
||||
Reference in New Issue
Block a user