Score All Asian from the entrant's own side
All Asian is two contests in one class and only one of them was written. An Asian entrant was paid three times the band table for every contact, including Asian ones, could work its own country, and counted WPX prefixes where the rules count DXCC entities. AllAsian now asks where the entrant is. An Asian station works anybody outside its own country, gets the band table once for Asia and three times for the rest, and counts entities. Everybody else works Asia only and counts prefixes, as before. Maritime mobiles follow the JARL rule rather than N1MM, which applies it to non-Asian entrants alone: a station at sea makes a valid contact with Asian stations only, is paid the Asian rate wherever it is, and counts for no multiplier either way. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0157i7PiZyqBkquxS9A6FTdQ
This commit is contained in:
@@ -0,0 +1,91 @@
|
||||
using Nonemm.Contests.Rules;
|
||||
using Nonemm.Core;
|
||||
|
||||
namespace Nonemm.Contests.Tests;
|
||||
|
||||
/// All Asian is two contests in one class: an entrant outside Asia works Asia
|
||||
/// for prefixes, and an Asian entrant works everybody else for countries and
|
||||
/// three times the points.
|
||||
public class AllAsianTests
|
||||
{
|
||||
private static ContestLog LogFor(StationInfo me) =>
|
||||
new(new AllAsian(ModeCategory.Phone), me, TestLog.CountryFile);
|
||||
|
||||
private static Qso Contact(string call, double kilohertz = 14_150) =>
|
||||
TestLog.Contact(call, kilohertz, mode: Modes.Usb, exchange: "46");
|
||||
|
||||
/// An Asian entrant scores the band table for another Asian station.
|
||||
[Theory]
|
||||
[InlineData(14_150, 1)]
|
||||
[InlineData(7_050, 1)]
|
||||
[InlineData(3_650, 2)]
|
||||
[InlineData(28_450, 2)]
|
||||
[InlineData(1_830, 3)]
|
||||
public void AsianEntrantScoresAsiaAtFaceValue(double kilohertz, int expected) =>
|
||||
Assert.Equal(
|
||||
expected,
|
||||
LogFor(TestLog.Japan).Judge(Contact("UA9XYZ", kilohertz)).Points);
|
||||
|
||||
/// Outside Asia is where an Asian entrant earns three times as much.
|
||||
[Theory]
|
||||
[InlineData(14_150, 3)]
|
||||
[InlineData(3_650, 6)]
|
||||
[InlineData(28_450, 6)]
|
||||
[InlineData(1_830, 9)]
|
||||
public void AsianEntrantScoresTrebleOutsideAsia(double kilohertz, int expected) =>
|
||||
Assert.Equal(
|
||||
expected,
|
||||
LogFor(TestLog.Japan).Judge(Contact("DL9XYZ", kilohertz)).Points);
|
||||
|
||||
/// Two stations in the same country cannot work each other.
|
||||
[Fact]
|
||||
public void AsianEntrantCannotWorkItsOwnCountry()
|
||||
{
|
||||
Verdict verdict = LogFor(TestLog.Japan).Judge(Contact("JA1XYZ"));
|
||||
Assert.Equal(0, verdict.Points);
|
||||
Assert.Empty(verdict.NewMultipliers);
|
||||
}
|
||||
|
||||
/// An Asian entrant counts countries, not WPX prefixes.
|
||||
[Fact]
|
||||
public void AsianEntrantCountsCountries() =>
|
||||
Assert.Equal(
|
||||
["K"],
|
||||
LogFor(TestLog.Japan).Judge(Contact("K1ABC")).NewMultipliers.Select(m => m.Value));
|
||||
|
||||
/// An entrant outside Asia counts the WPX prefixes of the Asian stations.
|
||||
[Fact]
|
||||
public void OutsideEntrantCountsPrefixes() =>
|
||||
Assert.Equal(
|
||||
["JA1"],
|
||||
LogFor(TestLog.Germany).Judge(Contact("JA1XYZ")).NewMultipliers.Select(m => m.Value));
|
||||
|
||||
/// A maritime mobile is worth nothing to an entrant outside Asia, and
|
||||
/// brings no multiplier to anybody.
|
||||
[Fact]
|
||||
public void MaritimeMobileScoresNothingOutsideAsia()
|
||||
{
|
||||
Verdict verdict = LogFor(TestLog.Germany).Judge(Contact("JA1XYZ/MM"));
|
||||
Assert.Equal(0, verdict.Points);
|
||||
Assert.Empty(verdict.NewMultipliers);
|
||||
}
|
||||
|
||||
/// A station at sea pays an Asian entrant the Asian rate, not three times
|
||||
/// it, and never brings a multiplier.
|
||||
[Fact]
|
||||
public void MaritimeMobilePaysAnAsianEntrantTheAsianRate()
|
||||
{
|
||||
Verdict verdict = LogFor(TestLog.Japan).Judge(Contact("DL9XYZ/MM"));
|
||||
Assert.Equal(1, verdict.Points);
|
||||
Assert.Empty(verdict.NewMultipliers);
|
||||
}
|
||||
|
||||
/// An entrant outside Asia may only work Asia.
|
||||
[Fact]
|
||||
public void OutsideEntrantCannotWorkOutsideAsia()
|
||||
{
|
||||
Verdict verdict = LogFor(TestLog.Germany).Judge(Contact("IK2XYZ"));
|
||||
Assert.Equal(0, verdict.Points);
|
||||
Assert.Empty(verdict.NewMultipliers);
|
||||
}
|
||||
}
|
||||
@@ -60,6 +60,15 @@ public static class TestLog
|
||||
ArrlSection = "CT",
|
||||
};
|
||||
|
||||
public static readonly StationInfo Japan = new()
|
||||
{
|
||||
Callsign = "JA1ABC",
|
||||
CqZone = 25,
|
||||
ItuZone = 45,
|
||||
Continent = "AS",
|
||||
CountryPrefix = "JA",
|
||||
};
|
||||
|
||||
public static readonly StationInfo Slovakia = new()
|
||||
{
|
||||
Callsign = "OM5M",
|
||||
|
||||
Reference in New Issue
Block a user