private string GenerateString(int minimum, int maximum) { int upperCaseA = 65; int upperCaseZ = 90; int lowerCaseA = 97; int lowerCaseZ = 122; int length = Arbitrary.Int32(minimum, maximum); StringBuilder builder = new StringBuilder(); for (int i = 0; i < length; i++) { int c; if (Arbitrary.Boolean()) { c = Arbitrary.Int32(upperCaseA, upperCaseZ); } else { c = Arbitrary.Int32(lowerCaseA, lowerCaseZ); } builder.Append((char)c); } return(builder.ToString()); }
/// <summary> /// Returns either True or False. /// </summary> /// <returns></returns> public static bool Boolean() { return(Arbitrary.Boolean()); }