Beispiel #1
0
 public void TestAddMediumToExistingCredit()
 {
     CreditList credits = new CreditList("DXCC:CARD&LOTW", aEnums);
     List<Credit> creds = credits.GetCredits("DXCC");
     Assert.AreEqual(1, creds.Count);
     Assert.AreEqual("DXCC:CARD&LOTW", creds[0].ToString());
     credits.Add(new Credit("DXCC:EQSL", aEnums));
     creds = credits.GetCredits("DXCC");
     Assert.AreEqual("DXCC:CARD&LOTW&EQSL", creds[0].ToString());
     Assert.IsTrue(creds[0].IsInMedia("EQSL"));
     Assert.IsTrue(creds[0].IsInMedia("LOTW"));
     Assert.IsTrue(creds[0].IsInMedia("CARD"));
 }
Beispiel #2
0
 public void TestAddSingleCredit()
 {
     Credit credit = new Credit("IOTA", aEnums);
     CreditList list = new CreditList();
     list.Add(credit);
     Assert.AreEqual(1, list.Count);
     List<Credit> credits = list.GetCredits("IOTA");
     Assert.AreEqual(1, credits.Count);
     Assert.AreEqual("IOTA", credits[0].CreditName);
     string[] media = new string[credits[0].Media.Count];
     credits[0].Media.CopyTo(media);
     Assert.AreEqual(null, media[0]);
 }
Beispiel #3
0
 public void TestGetCreditsTwoMatchingCredits()
 {
     Credit credit = new Credit("IOTA", aEnums);
     CreditList list = new CreditList();
     list.Add(credit);
     Credit notIOTA = new Credit("WAS", aEnums);
     list.Add(notIOTA);
     Credit credit2 = new Credit("IOTA:Card&Lotw", aEnums);
     list.Add(credit2);
     List<Credit> credits = list.GetCredits("IOTA");
     Assert.AreEqual(2, credits.Count);
     Assert.AreEqual("IOTA", credits[0].CreditName);
     string[] media = new string[credits[0].Media.Count];
     credits[0].Media.CopyTo(media);
     Assert.AreEqual(null, media[0]);
     Assert.AreEqual("IOTA", credits[1].CreditName);
     media = new string[credits[1].Media.Count];
     credits[1].Media.CopyTo(media);
     Assert.AreEqual("CARD", media[0]);
     Assert.AreEqual("LOTW", media[1]);
 }
Beispiel #4
0
 public void TestGetCreditsNoMatchingCredits()
 {
     Credit credit = new Credit("IOTA", aEnums);
     CreditList list = new CreditList();
     list.Add(credit);
     Credit notIOTA = new Credit("WAS", aEnums);
     list.Add(notIOTA);
     Credit credit2 = new Credit("IOTA:Card&Lotw", aEnums);
     list.Add(credit2);
     List<Credit> credits = list.GetCredits("WAB");
     Assert.AreEqual(0, credits.Count);
 }
Beispiel #5
0
 public void TestAddTwoCreditsNullAndMedium()
 {
     Credit credit = new Credit("IOTA", aEnums);
     CreditList list = new CreditList();
     list.Add(credit);
     Assert.AreEqual(1, list.Count);
     Credit c2 = new Credit("IOTA:CARD", aEnums);
     list.Add(c2);
     Assert.AreEqual(2, list.Count);
     List<Credit> credits = list.GetCredits("IOTA");
     Assert.AreEqual(2, credits.Count);
     Assert.AreEqual("IOTA", credits[0].CreditName);
     string[] media = new string[credits[0].Media.Count];
     credits[0].Media.CopyTo(media);
     Assert.AreEqual(null, media[0]);
     media = new string[credits[1].Media.Count];
     credits[1].Media.CopyTo(media);
     Assert.AreEqual(1, media.Length);
     Assert.AreEqual("CARD", media[0]);
 }
Beispiel #6
0
 public void TestAddTwoCreditsDifferentMedia()
 {
     Credit credit = new Credit("IOTA:EQSL&LOTW", aEnums);
     CreditList list = new CreditList();
     list.Add(credit);
     Credit c2 = new Credit("IOTA:CARD", aEnums);
     list.Add(c2);
     Assert.AreEqual(1, list.Count);
     List<Credit> credits = list.GetCredits("IOTA");
     Assert.AreEqual(1, credits.Count);
     Assert.AreEqual("IOTA", credits[0].CreditName);
     string[] media = new string[credits[0].Media.Count];
     credits[0].Media.CopyTo(media);
     Assert.AreEqual(3, media.Length);
     Assert.AreEqual("EQSL", media[0]);
     Assert.AreEqual("LOTW", media[1]);
     Assert.AreEqual("CARD", media[2]);
 }