Exemplo n.º 1
0
        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));
            }
        }
Exemplo n.º 2
0
        public void CodeIsAnInt32()
        {
            int code = OpponentCode.GenerateRandomCode();

            Assert.That(code.GetType().ToString(), Is.EqualTo("System.Int32"));
        }
Exemplo n.º 3
0
        public void CodeIsFourNumbersInLength()
        {
            int code = OpponentCode.GenerateRandomCode();

            Assert.That(code.ToString().Count, Is.EqualTo(4));
        }