using Nonemm.Core; namespace Nonemm.Session.Tests; public class BandMemoryTests { [Fact] public void AnUnvisitedBandStartsWhereThatPartOfItStarts() { BandMemory memory = new(); Assert.Equal(Bands.Band20M.Low, memory.Where(Bands.Band20M, ModeCategory.Cw, BandPlan.Default)); Assert.Equal( Frequency.FromKilohertz(14_150), memory.Where(Bands.Band20M, ModeCategory.Phone, BandPlan.Default)); } [Fact] public void TheBandComesBackWhereItWasLeft() { BandMemory memory = new(); memory.Remember(Frequency.FromKilohertz(14_032), Modes.Cw); memory.Remember(Frequency.FromKilohertz(7_012), Modes.Cw); Assert.Equal( Frequency.FromKilohertz(14_032), memory.Where(Bands.Band20M, ModeCategory.Cw, BandPlan.Default)); Assert.Equal( Frequency.FromKilohertz(7_012), memory.Where(Bands.Band40M, ModeCategory.Cw, BandPlan.Default)); } [Fact] public void EachModeOnABandIsRememberedOnItsOwn() { BandMemory memory = new(); memory.Remember(Frequency.FromKilohertz(14_032), Modes.Cw); memory.Remember(Frequency.FromKilohertz(14_240), Modes.Usb); Assert.Equal( Frequency.FromKilohertz(14_032), memory.Where(Bands.Band20M, ModeCategory.Cw, BandPlan.Default)); Assert.Equal( Frequency.FromKilohertz(14_240), memory.Where(Bands.Band20M, ModeCategory.Phone, BandPlan.Default)); } [Fact] public void ABandWithNoPlanStartsAtItsBottomEdge() { BandMemory memory = new(); Assert.Equal( Bands.Band60M.Low, memory.Where(Bands.Band60M, ModeCategory.Phone, BandPlan.Default)); } }