Beispiel #1
0
 /// <summary>
 /// Helper method that validates manager callsign
 /// </summary>
 /// <returns>validation string (error string or null if no error)</returns>
 private string ValidateManager()
 {
     if(Manager == string.Empty)
     {
         return null;
     }
     string err = string.Empty;
     string mod = string.Empty;
     Call mgrCall = new Call(Manager);
     if(!mgrCall.Validate(out err, out mod))
     {
         return "Not a valid callsign";
     }
     if(mgrCall.Value != mgrCall.GetCall())
     {
         return "Manager callsign must not contain modifiers (e.g. VA3HJ, not XE1/VA3HJ)";
     }
     return null;
 }
Beispiel #2
0
 public void TestGetCallSuffix()
 {
     Call call = new Call("VA3HJ/P");
     Assert.AreEqual("VA3HJ", call.GetCall());
 }
Beispiel #3
0
 public void TestGetCallVP2E()
 {
     Call call = new Call("VP2E");
     Assert.AreEqual("VP2E", call.GetCall());
 }
Beispiel #4
0
 public void TestGetCallPrefix()
 {
     Call call = new Call("9A5/VA3HJ");
     Assert.AreEqual("VA3HJ", call.GetCall());
 }
Beispiel #5
0
 public void TestGetCallR1FJPrefix()
 {
     Call call = new Call("R1FJ/UA0BMD");
     Assert.AreEqual("UA0BMD", call.GetCall());
 }
Beispiel #6
0
 public void TestGetCallNone()
 {
     Call call = new Call("VA3HJ");
     Assert.AreEqual("VA3HJ", call.GetCall());
 }
Beispiel #7
0
 public void TestGetCallInvalidCall()
 {
     Call call = new Call("VAHJ");
     Assert.AreEqual(null, call.GetCall());
 }
Beispiel #8
0
 public void TestGetCall5C5CW()
 {
     Call call = new Call("5C5CW");
     Assert.AreEqual("5C5CW", call.GetCall());
 }
Beispiel #9
0
 public void TestGetCallXM31812()
 {
     Call call = new Call("XM31812");
     Assert.AreEqual("XM31812", call.GetCall());
 }
Beispiel #10
0
 /// <summary>
 /// Validator from the IDataErrorInfo interface
 /// </summary>
 public string this[string propertyName]
 {
     get
     {
         if(propertyName == "Manager")
         {
             if(Manager == string.Empty)
             {
                 return null;
             }
             Call mgr = new Call(Manager);
             string err = string.Empty;
             string mod = string.Empty;
             if(mgr.Value != mgr.GetCall() || !mgr.Validate(out err, out mod))
             {
                 return "Must either be empty or a valid callsign";
             }
         }
         return null;
     }
 }