public void GetOnlyLow() { var cache = A.Fake<ICache>(); var settings = new Dictionary<string, string> { { Keys.Contains, Keys.LowerLetters }, { Keys.Length, "3" }, }; var obj = new RandomStringProvider(cache, settings); var result = obj.GetAll(); var j = 9; foreach (var t in result) { Assert.True((string)t[0] == ((string)t[0]).ToLower(CultureInfo.InvariantCulture)); if (j-- == 0) break; } }
public void GetOnlyNumbers() { var cache = A.Fake<ICache>(); var settings = new Dictionary<string, string> { { Keys.Contains, Keys.Numbers }, { Keys.Length, "3" }, }; var obj = new RandomStringProvider(cache, settings); var result = obj.GetAll(); var j = 9; foreach (var t in result) { for (var i = 0; i < 3; i++) { Assert.DoesNotThrow(() => Convert.ToInt32(((string)t[0])[i])); } if (j-- == 0) break; } }