using Nonemm.App.Windows; using Nonemm.Contests; using Nonemm.Core; using Nonemm.Session; using Nonemm.Spotting; namespace Nonemm.App.Tests; public class AvailableRowTests { private static readonly DateTime Now = new(2026, 5, 30, 12, 0, 0, DateTimeKind.Utc); private static AvailableRow Row(string comment) { Spot spot = new( Callsign.Parse("DL1ABC"), Frequency.FromKilohertz(14_025), Now.AddMinutes(-5), SpotSource.Cluster, "OK1TEST", comment); return new AvailableRow(new AvailableStation(spot, Bands.Band20M, Verdict.Dupe), "CW", Now, null, false, false); } [Fact] public void TheHoverTextHasNoControlCharactersOtherThanLineBreaks() { string tip = Row("CW 24 dB\r\a 1234Z\r\n").Tip; Assert.DoesNotContain(tip, c => char.IsControl(c) && c != '\n'); } [Fact] public void TheHoverTextLeavesOutTheClusterTimeAndTheSideband() { Assert.DoesNotContain("1234Z", Row("CW 24 dB 1234Z").Tip); Assert.Equal("14025.0 by OK1TEST, 5m ago", Row("USB").Tip); } }