Frequencies, bands, modes, callsigns, grid squares and the country file live in Nonemm.Core. Nonemm.Contests holds the scoring engine and CQ WW and CQ WPX. Nonemm.Storage writes N1MM's DXLOG schema, and Nonemm.Formats writes Cabrillo 3.0 and reads and writes ADIF. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
35 lines
1.0 KiB
C#
35 lines
1.0 KiB
C#
using Nonemm.Core;
|
|
|
|
namespace Nonemm.Core.Tests;
|
|
|
|
public class BandsTests
|
|
{
|
|
[Theory]
|
|
[InlineData(1830, "160M")]
|
|
[InlineData(3510.5, "80M")]
|
|
[InlineData(14025, "20M")]
|
|
[InlineData(28499, "10M")]
|
|
[InlineData(50110, "6M")]
|
|
[InlineData(144200, "2M")]
|
|
public void FrequencyLandsOnItsBand(double kilohertz, string expected) =>
|
|
Assert.Equal(expected, Bands.ForFrequency(Frequency.FromKilohertz(kilohertz))?.Name);
|
|
|
|
[Fact]
|
|
public void FrequencyOutsideEveryAllocationHasNoBand() =>
|
|
Assert.Null(Bands.ForFrequency(Frequency.FromKilohertz(12000)));
|
|
|
|
[Fact]
|
|
public void BandEdgesAreIncluded()
|
|
{
|
|
Assert.Equal("20M", Bands.ForFrequency(Frequency.FromKilohertz(14000))?.Name);
|
|
Assert.Equal("20M", Bands.ForFrequency(Frequency.FromKilohertz(14350))?.Name);
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData(1.8, "160M")]
|
|
[InlineData(5, "60M")]
|
|
[InlineData(76000, "4MM")]
|
|
public void N1mmBandLabelFindsTheBand(double label, string expected) =>
|
|
Assert.Equal(expected, Bands.ByLabel(label)?.Name);
|
|
}
|