public void RangeTest() { var promoGen = new PromoCardGenerator (testKey2, 6); for (int i = 0; i < 100000; i++){ var code = promoGen.GenerateCode (i); var number = promoGen.ExtractNumber (code); Assert.AreEqual (i, number); } }
public void RangeUniqueTest() { var promoGen = new PromoCardGenerator (testKey2, 6); var list = new List<string> (); for (int i = 0; i < 10000; i++){ var code = promoGen.GenerateCode (i); var number = promoGen.ExtractNumber (code); Assert.AreEqual (i, number); Assert.IsFalse (list.Contains (code)); list.Add (code); } Assert.AreEqual (10000, list.Count); }