예제 #1
0
 public void TestValidManager()
 {
     Qsos2 qsos2 = new Qsos2();
     string err = string.Empty;
     Qso2 qso = new Qso2("<QSL_VIA:5>VA3HJ<eor>", App.AdifEnums, ref err, qsos2);
     QsoWithInclude qwi = new QsoWithInclude(qso);
     string error = qwi["Manager"];
     Assert.IsNull(error);
 }
예제 #2
0
 public void TestInvalidManagerPrefix()
 {
     Qsos2 qsos2 = new Qsos2();
     string err = string.Empty;
     Qso2 qso = new Qso2("<QSL_VIA:9>VP9/VA3HJ<eor>", App.AdifEnums, ref err, qsos2);
     QsoWithInclude qwi = new QsoWithInclude(qso);
     string error = qwi["Manager"];
     Assert.AreEqual("Must either be empty or a valid callsign", error);
 }
예제 #3
0
 public void TestAddQsoNoQsos2()
 {
     string err = string.Empty;
     Qso2 qso = new Qso2("<Mode:3>SSB<Band:3>40m<qso_date:8>20130615<time_on:6>124316",
                         aEnums, ref err);
     QsoWithInclude qwi = new QsoWithInclude(qso);
     DisplayQsos dQsos = new DisplayQsos();
     Assert.IsFalse(dQsos.IsDirty);
     Assert.IsFalse(dQsos.NeedsSorting);
     dQsos.AddQso(qwi);
     Assert.AreEqual(1, dQsos.Count);
     Assert.IsTrue(dQsos.IsDirty);
     Assert.IsTrue(dQsos.NeedsSorting);
 }
예제 #4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="qwi">QsoWithInclude object to build DispQso from</param>
 public DispQso(QsoWithInclude qwi)
 {
     Regex mgrReg = new Regex("[A-Za-z0-9]");
     if(mgrReg.IsMatch(qwi.Manager))	// check valid character
     {
         Manager = qwi.Manager;
     }
     Callsign = qwi.Callsign;
     Date = qwi.Date;
     Time = qwi.Time;
     Band = qwi.Band;
     Frequency = qwi.Frequency;
     Mode = qwi.Mode;
     Submode = qwi.Submode;
     RST = qwi.RST;
     Qsl = qwi.Rcvd;
     Qso = qwi.Qso;
 }
예제 #5
0
 /// <summary>
 /// Helper method that saves a QSO, then clears the fields in QsoInputDialog
 /// </summary>
 /// <returns>false if there is an error in the QSO data, true otherwiser</returns>
 private bool SaveQso()
 {
     Qso2 qso = BuildQsoFromInput();
     QsoWithInclude qwi = new QsoWithInclude(qso);
     dispQsos.AddQso(qwi);
     QsoData.ClearQsoData();
     return true;
 }