예제 #1
0
        public void Return4DigitsBetween1And6()
        {
            var answer = GameAnswers.GenerateRandomAnswer();

            answer.Length.ShouldBe(4);
            foreach (var d in answer)
            {
                d.ShouldBeInRange(1, 6);
            }
        }
        public void ReturnAllUniqueDigitsGivenEasyModeAndTenCalls()
        {
            for (int i = 0; i < 361; i++) //using 6*5*4*3 probability to make sure more than all combinations are used
            {
                var result = GameAnswers.GenerateRandomAnswer();
                var length = result.Length;

                System.Diagnostics.Debug.WriteLine(string.Join("-", result));

                result.AsEnumerable().Distinct().Count().ShouldBe(length);
            }
            System.Diagnostics.Debug.WriteLine("This is to set a breakpoint to check the result log");
        }
예제 #3
0
        public void Return4DigitsLong()
        {
            var answer = GameAnswers.GenerateRandomAnswer();

            answer.Length.ShouldBe(4);
        }