using Nonemm.Contests.Rules; using Nonemm.Core; namespace Nonemm.Contests.Tests; public class YotaTests { private static ContestLog LogFor(StationInfo me) => new(new Yota(), me, TestLog.CountryFile); private static Qso Contact(string call, string age, double kilohertz = 14_025, Mode? mode = null) => TestLog.Contact(call, kilohertz, mode: mode, exchange: age); [Theory] [InlineData("9", 13)] [InlineData("12", 13)] [InlineData("13", 12)] [InlineData("16", 12)] [InlineData("17", 11)] [InlineData("21", 11)] [InlineData("22", 10)] [InlineData("25", 10)] [InlineData("26", 1)] public void AYoungOperatorIsWorthMore(string age, int expected) => Assert.Equal(expected, LogFor(TestLog.Germany).Judge(Contact("IK2XYZ", age)).Points); /// The age pays the same from anywhere; only the contacts with everyone /// else are scored by continent. [Fact] public void AgeBeatsTheContinent() { ContestLog log = LogFor(TestLog.Germany); Assert.Equal(13, log.Judge(Contact("JA1XYZ", "11")).Points); Assert.Equal(3, log.Judge(Contact("JA1XYZ", "44")).Points); Assert.Equal(1, log.Judge(Contact("IK2XYZ", "44")).Points); } [Fact] public void AnAgeCountsOncePerBandWhateverTheMode() { ContestLog log = LogFor(TestLog.Germany); log.Add(Contact("IK2XYZ", "19")); Assert.Empty(log.Judge(Contact("DL9XYZ", "19", mode: Modes.Usb)).NewMultipliers); Assert.Single(log.Judge(Contact("DL9XYZ", "19", 7_025)).NewMultipliers); } [Fact] public void AnExchangeThatIsNoAgeBringsNoMultiplier() => Assert.Empty(LogFor(TestLog.Germany).Judge(Contact("IK2XYZ", "")).NewMultipliers); }