public void TestRandomFromCollection() { object t = new object(); object r = RandomPicks.RandomFrom(Random, new HashSet <object>(new object[] { t })); Assert.AreSame(r, t); }
public void TestRandomFromEmptyCollection() { Assert.Throws <ArgumentException>(() => RandomPicks.RandomFrom(Random, new HashSet <object>())); }
public void TestRandomFromArray() { Assert.Throws <ArgumentException>(() => RandomPicks.RandomFrom(Random, new object[] { })); }
public void TestRandomFromList() { Assert.Throws <ArgumentException>(() => RandomPicks.RandomFrom(Random, new List <object>())); }