public void CountryParse_CasesFromJapan_Pass(string call)
        {
            CountryParser countries = new CountryParser(@"C:\Users\mike\Documents\GitHub\NM20\NM2O_Spot_Analyzer\NM2O_Spot_Analyzer\bin\Debug\N1MM_CountryList.dat");

            ICountryZone a = countries.CheckCall(call);

            Assert.AreEqual("Japan", a.Country);
        }
        public void CountryParseSimple()
        {
            CountryParser countries = new CountryParser(@"C:\Users\mike\Documents\GitHub\NM20\NM2O_Spot_Analyzer\NM2O_Spot_Analyzer\bin\Debug\N1MM_CountryList.dat");

            ICountryZone a = countries.CheckCall("BY8A1");

            Assert.AreEqual(false, true);
        }
 public SpotValueModel(string call, ICountryZone countryZone, RadioInfo.BandName band, int multiplier)
 {
     Call            = call;
     Band            = band;
     CountryZone     = countryZone;
     Multiplier      = multiplier;
     CountryScarcity = Math.Log10((double)CZLabelBand("Totals", Band) / (CZLabelBand(CountryZone.Country, Band) + 1)); //Prevent divide by zero
     ZoneScarcity    = Math.Log10((double)CZLabelBand("Totals", Band) / (CZLabelBand(CountryZone.CQZone.ToString(), Band) + 1));
     try
     {
         CallScarcity = (double)(PrecalculatedAnalysis.Call_Analysis.Where(x => x.Call == call).FirstOrDefault().HoursWorked) / 6;
     }
     catch (Exception)
     {
         CallScarcity = 8;
     }
 }
        public ICountryZone CheckCall(string call)
        {
            ICountryZone co = CallOverrides.Where(x => x.Call == call).FirstOrDefault();

            if (co != null)
            {
                return(co);
            }
            //TODO pick apart spots with slashes.
            for (int i = call.Length; i > 0; i--)
            {
                ICountryZone cp = CallPrefixes.Where(x => string.Equals(x.Prefix, call.Substring(0, i), StringComparison.CurrentCultureIgnoreCase) == true).FirstOrDefault();
                if (cp != null)
                {
                    return(cp);
                }
            }

            throw new Exception();
        }