public void RandomNumberGeneratorReturnsEmptyStringWhenAllNumbersAreCalled() { var sut = new BingoCaller(new Random()); for (var i = 1; i <= 75; i++) { sut.GetNumber(); } Assert.AreEqual("", sut.GetNumber()); }
public void BingoCallerReturnsCorrectString(int number, string expected) { var sut = new BingoCaller(new FakeRandom(number)); var actual = sut.GetNumber(); Assert.AreEqual(expected, actual); }
public void RandomNumberGeneratorReturnsAllNumbersOnlyOnce() { var list = new List <string>(); var sut = new BingoCaller(new Random()); for (var i = 1; i <= 75; i++) { list.Add(sut.GetNumber()); } Assert.AreEqual(list.Count, list.Distinct().Count()); }
public void EachNumberIsBetween1And75() { var caller = new BingoCaller(new Random()); for (var i = 1; i <= 75; i++) { var number = caller.GetNumber(); var n = Convert.ToInt32(number.Substring(1)); Assert.LessOrEqual(1, n); Assert.GreaterOrEqual(75, n); } }