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); } }