Checked by opening a log this program wrote in N1MM 1.0.11031. Three things it rejected: - a log naming a contest with no row in the Contest table throws "No current row" in Contest.FromRow, so the definition row is written whenever a contest is opened; - an empty overlay category is answered with "Invalid Overlay Category:", so an entry with no overlay now says "N/A", and the dialog offers N1MM's list; - the sent exchange omits the report, which is what N1MM's own contest dialog asks for. With those three fixed N1MM opens the log and shows the contacts. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
43 lines
1.4 KiB
C#
43 lines
1.4 KiB
C#
using Nonemm.Contests.Rules;
|
|
using Nonemm.Core;
|
|
using Nonemm.Storage;
|
|
|
|
namespace Nonemm.Session.Tests;
|
|
|
|
public class ContestDefinitionsTests
|
|
{
|
|
[Fact]
|
|
public void NamesAndModeComeFromTheContest()
|
|
{
|
|
ContestDefinition definition = ContestDefinitions.For(new CqWorldWide(ModeCategory.Cw));
|
|
Assert.Equal("CQWW", definition.Name);
|
|
Assert.Equal("CQ-WW-CW", definition.CabrilloName);
|
|
Assert.Equal("CW", definition.Mode);
|
|
}
|
|
|
|
[Fact]
|
|
public void MultiplierNamesFillUpToThree()
|
|
{
|
|
ContestDefinition definition = ContestDefinitions.For(new CqWorldWide(ModeCategory.Cw));
|
|
Assert.Equal("Zones", definition.Multiplier1Name);
|
|
Assert.Equal("Countries", definition.Multiplier2Name);
|
|
Assert.Equal("N/A", definition.Multiplier3Name);
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData(typeof(Sweepstakes), 1)]
|
|
[InlineData(typeof(CqWorldWide), 2)]
|
|
[InlineData(typeof(IaruHf), 3)]
|
|
public void DupeScopeBecomesN1mmsDupeType(Type contest, int expected)
|
|
{
|
|
object made = contest == typeof(IaruHf)
|
|
? new IaruHf()
|
|
: Activator.CreateInstance(contest, ModeCategory.Cw)!;
|
|
Assert.Equal(expected, ContestDefinitions.For((Contests.Contest)made).DupeType);
|
|
}
|
|
|
|
[Fact]
|
|
public void ContestWithSeveralModesIsBoth() =>
|
|
Assert.Equal("BOTH", ContestDefinitions.For(new IaruHf()).Mode);
|
|
}
|