Files
Nonemm/tests/Nonemm.Contests.Tests/EuDxContestTests.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

31 lines
1.2 KiB
C#

using Nonemm.Contests.Rules;
using Nonemm.Core;
namespace Nonemm.Contests.Tests;
public class EuDxContestTests
{
private static ContestLog LogFor(StationInfo me) => new(new EuDxContest(), me, TestLog.CountryFile);
private static Qso Contact(string call, string code) =>
TestLog.Contact(call, mode: Modes.Usb, section: code);
/// The contest's Europe is the European Union, so a Japanese contact is 5
/// points and an Italian one 10.
[Theory]
[InlineData("IK2XYZ", "IT01", 10)]
[InlineData("DL9XYZ", "DL01", 2)]
[InlineData("JA1XYZ", "25", 5)]
public void PointsGoByTheUnionList(string call, string code, int expected) =>
Assert.Equal(expected, LogFor(TestLog.Germany).Judge(Contact(call, code)).Points);
/// A station outside the union sends a zone, which is no multiplier.
[Fact]
public void OnlyAUnionStationBringsACodeMultiplier()
{
ContestLog log = LogFor(TestLog.Germany);
Assert.Equal([1, 2], log.Judge(Contact("IK2XYZ", "IT01")).NewMultipliers.Select(m => m.Index).ToList());
Assert.Equal([2], log.Judge(Contact("JA1XYZ", "25")).NewMultipliers.Select(m => m.Index).ToList());
}
}