Read the exchange boxes a published .udc file actually names
The box names in EntryWindowInfo are N1MM's LogItem.LogItemNameType members. We read four of them under names that are not in that enum, so a file naming its section box SectionText got no section box at all, and a zone or a power box was dropped whatever it was called. SectionText, CQZoneText and PowerText are now read. SectText stays as well: it is not one of N1MM's names but files in the wild use it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -74,4 +74,36 @@ public class UserDefinedContestTests
|
||||
log.Add(TestLog.Contact("JA1XYZ"));
|
||||
Assert.False(log.Judge(TestLog.Contact("JA1XYZ")).IsDupe);
|
||||
}
|
||||
|
||||
/// The box names in a published file are N1MM's `LogItemNameType` members.
|
||||
[Fact]
|
||||
public void TheZoneStateAndPowerBoxesAreRead()
|
||||
{
|
||||
UserDefinedContest contest = new(UdcFile.Parse("""
|
||||
[Contest]
|
||||
Name=BOXTEST
|
||||
EntryWindowInfo=RCVText, 400, CQZoneText, 300, SectionText, 300, PowerText, 300
|
||||
FrameText=RST Zone Sect Pwr
|
||||
"""));
|
||||
|
||||
Assert.Equal(
|
||||
[ExchangeSlot.ReceivedReport, ExchangeSlot.Zone, ExchangeSlot.Section, ExchangeSlot.Power],
|
||||
contest.ExchangeFieldsFor(TestLog.Germany).Select(f => f.Slot).ToList());
|
||||
}
|
||||
|
||||
/// The sent-side boxes are in the same setting and are not exchange boxes.
|
||||
[Fact]
|
||||
public void TheSentBoxesAreLeftOutOfTheExchange()
|
||||
{
|
||||
UserDefinedContest contest = new(UdcFile.Parse("""
|
||||
[Contest]
|
||||
Name=SENTTEST
|
||||
EntryWindowInfo=SNTText, 400, SntNrText, 300, RCVText, 400, RcvNrText, 300
|
||||
FrameText=Snt SntNr RST Nr
|
||||
"""));
|
||||
|
||||
Assert.Equal(
|
||||
[ExchangeSlot.ReceivedReport, ExchangeSlot.SerialNumber],
|
||||
contest.ExchangeFieldsFor(TestLog.Germany).Select(f => f.Slot).ToList());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user