Nonemm.Session holds what the operator is typing, what the log says about it and what happens on Enter, with no UI toolkit behind it. Nonemm.Rig talks to hamlib's rigctld and reconnects on its own. Nonemm.Spotting reads DX cluster lines into a bandmap that drops spots after an hour. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
using Nonemm.Core;
|
|
|
|
namespace Nonemm.Spotting.Tests;
|
|
|
|
public class SpotLineTests
|
|
{
|
|
private static readonly DateTime Now = new(2026, 5, 30, 12, 40, 0, DateTimeKind.Utc);
|
|
|
|
[Fact]
|
|
public void ANodeSpotIsReadIntoItsParts()
|
|
{
|
|
Spot? spot = SpotLine.Parse(
|
|
"DX de W3LPL: 14025.0 DL1ABC CW 20 dB 25 WPM CQ 1234Z",
|
|
Now);
|
|
|
|
Assert.NotNull(spot);
|
|
Assert.Equal("DL1ABC", spot.Call.Text);
|
|
Assert.Equal(14_025_000, spot.Frequency.Hertz);
|
|
Assert.Equal("W3LPL", spot.Spotter);
|
|
Assert.Equal(new DateTime(2026, 5, 30, 12, 34, 0, DateTimeKind.Utc), spot.AtUtc);
|
|
Assert.DoesNotContain("1234Z", spot.Comment);
|
|
}
|
|
|
|
[Fact]
|
|
public void OtherTrafficIsNotASpot() =>
|
|
Assert.Null(SpotLine.Parse("WWV de VE7CC <18Z> : SFI=142, A=7, K=2", Now));
|
|
|
|
[Fact]
|
|
public void ASpotTimedAfterNowCameInYesterday()
|
|
{
|
|
Spot? spot = SpotLine.Parse("DX de W3LPL: 14025.0 DL1ABC CQ 2350Z", Now);
|
|
Assert.Equal(new DateTime(2026, 5, 29, 23, 50, 0, DateTimeKind.Utc), spot?.AtUtc);
|
|
}
|
|
}
|