using Nonemm.Core; namespace Nonemm.Core.Tests; /// The mode names that come back from a radio. public class ModesTests { /// hamlib answers `m` with its own names. A radio in a data mode is on a /// digital mode, which is how AFSK RTTY is run, and the program sends /// `PKTUSB` itself when it puts a radio on one. [Theory] [InlineData("PKTUSB")] [InlineData("PKTLSB")] [InlineData("PKTFM")] [InlineData("RTTY")] [InlineData("RTTYR")] public void AHamlibDataModeIsADigitalMode(string reported) => Assert.Equal(ModeCategory.Digital, Modes.Parse(reported)?.Category); [Theory] [InlineData("CW", "CW")] [InlineData("CWR", "CW")] [InlineData("USB", "USB")] [InlineData("SSB", "USB")] public void TheOtherNamesStillReadTheWayTheyDid(string reported, string expected) => Assert.Equal(expected, Modes.Parse(reported)?.Name); [Fact] public void AModeNobodyKnowsIsNull() => Assert.Null(Modes.Parse("SPARK")); }