Files
Nonemm/tests/Nonemm.Contests.Tests/CqOneSixtyTests.cs
ericek111 7d9bc05e9a Add IOTA, the EU DX Contest, CQ 160 and Mexico RTTY
Four more of the contests in the station's log. IOTA, CQ 160 and Mexico RTTY
score every contact in it exactly as N1MM did.

IOTA pays 15 points for a station that sends an island reference and 2 for one
that does not, and counts each reference once per band and mode. CQ 160 is one
band, so its states and countries count once each. Mexico RTTY and CQ 160 both
take a state from one side of the contest and a serial or a zone from the
other, in the columns N1MM keeps them in.

The EU DX Contest is written from N1MM's class, including its list of what
counts as Europe: the European Union, its outermost regions and its overseas
territories, and nothing else. The station's own logs were made with the .udc
file, which scores and counts two things differently; docs/unfinished.md says
which.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RoGtneMQaz4M9w7Kk49AVD
2026-08-31 09:33:29 +00:00

34 lines
1.2 KiB
C#

using Nonemm.Contests.Rules;
using Nonemm.Core;
namespace Nonemm.Contests.Tests;
public class CqOneSixtyTests
{
private static readonly Contest Ssb = new CqOneSixty(ModeCategory.Phone);
private static ContestLog LogFor(StationInfo me) => new(Ssb, me, TestLog.CountryFile);
private static Qso Contact(string call, string zone = "15", string stateOrProvince = "") =>
TestLog.Contact(call, 1_830, mode: Modes.Lsb, exchange: zone, section: stateOrProvince);
[Theory]
[InlineData("DL9XYZ", 2)]
[InlineData("IK2XYZ", 5)]
[InlineData("JA1XYZ", 10)]
public void PointsGoByCountryAndContinent(string call, int expected) =>
Assert.Equal(expected, LogFor(TestLog.Germany).Judge(Contact(call)).Points);
/// One band, so a country and a state each count once in the contest.
[Fact]
public void CountriesAndStatesEachCountOnce()
{
ContestLog log = LogFor(TestLog.Germany);
Assert.Equal(
[1, 2],
log.Judge(Contact("K1ABC", stateOrProvince: "CT")).NewMultipliers.Select(m => m.Index).ToList());
log.Add(Contact("K1ABC", stateOrProvince: "CT"));
Assert.Empty(log.Judge(Contact("K2ABC", stateOrProvince: "CT")).NewMultipliers);
}
}