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