public void RandomNumbersAreWithinRange() { List <int> invalidNumbers = new List <int>(); invalidNumbers.Add(0); invalidNumbers.Add(7); invalidNumbers.Add(8); invalidNumbers.Add(9); int code = OpponentCode.GenerateRandomCode(); foreach (var num in invalidNumbers) { Assert.That(code, Does.Not.Contain(num)); } }
public void CodeIsAnInt32() { int code = OpponentCode.GenerateRandomCode(); Assert.That(code.GetType().ToString(), Is.EqualTo("System.Int32")); }
public void CodeIsFourNumbersInLength() { int code = OpponentCode.GenerateRandomCode(); Assert.That(code.ToString().Count, Is.EqualTo(4)); }