public void ConsecutiveGeneratedNamesAreUnique() { var Namer = new name_on_core.Namer(); var name1 = Namer.Gen(); var name2 = Namer.Gen(); Assert.AreNotEqual(name1, name2); }
public void NamesAreStringDashStringDashNumber() { var Namer = new name_on_core.Namer(); var name1 = Namer.Gen(); var pattern = @"^[a-zA-Z]+-[a-zA-Z]+-\d+$"; var r = new Regex(pattern); Assert.IsTrue(r.IsMatch(name1), $"Wrong Pattern: {name1} doesn't match {pattern}"); }
public void NamesAreVeryUnique() { var n = new name_on_core.Namer(); var max = 1000000; var d = new Dictionary <string, int>(); for (var i = 0; i < max; i++) { var name = n.Gen(); try { d.Add(name, 0); }catch (System.ArgumentException) { Debug.WriteLine(name); } } }