using Nonemm.Contests.Rules; using Nonemm.Core; namespace Nonemm.Contests.Tests; public class Arrl10MetreTests { private static ContestLog LogFor() => new(new Arrl10Metre(), TestLog.Germany, TestLog.CountryFile); private static Qso Contact(string call, Mode mode, string state = "", string number = "") => TestLog.Contact(call, 28_025, mode: mode, section: state, exchange: number); [Fact] public void CwIsWorthFourAndPhoneTwo() { ContestLog log = LogFor(); Assert.Equal(4, log.Judge(Contact("K1ABC", Modes.Cw, state: "CT")).Points); Assert.Equal(2, log.Judge(Contact("K1ABC", Modes.Usb, state: "CT")).Points); } /// The contest is one band and counts its multipliers once per mode. [Fact] public void AMultiplierCountsOncePerMode() { ContestLog log = LogFor(); log.Add(Contact("K1ABC", Modes.Cw, state: "CT")); Assert.Empty(log.Judge(Contact("K2ABC", Modes.Cw, state: "CT")).NewMultipliers); Assert.Single(log.Judge(Contact("K2ABC", Modes.Usb, state: "CT")).NewMultipliers); } [Fact] public void AStationWithNoStateBringsItsCountry() => Assert.Equal( [2], LogFor().Judge(Contact("JA1XYZ", Modes.Cw, number: "042")).NewMultipliers .Select(m => m.Index) .ToList()); }