public void Create() { var cache = A.Fake<ICache>(); var settings = new Dictionary<string, string> { { Keys.Contains, string.Empty }, { Keys.Length, "3" }, }; var obj = new RandomStringProvider(cache, settings); Assert.IsNotNull(obj); }
public void GetOnlyUpper() { var cache = A.Fake<ICache>(); var settings = new Dictionary<string, string> { { Keys.Contains, Keys.UpperLetters }, { 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]).ToUpper(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; } }