예제 #1
0
        public void DoubleColaTests3()
        {
            string[] names = new string[] { "Sheldon", "Leonard", "Penny", "Rajesh", "Howard" };
            int      n     = 52;

            Assert.AreEqual("Penny", DoubleCola.WhoIsNext(names, n));
        }
예제 #2
0
        public void Test4()
        {
            string[] names = new string[] { "Sheldon", "Leonard", "Penny", "Rajesh", "Howard" };
            int      n     = 6;

            Assert.AreEqual("Leonard", DoubleCola.WhoIsNext(names, 7230702951));
        }
예제 #3
0
        public void DoubleColaTests4()
        {
            string[] names = new string[] { "Sheldon", "Leonard", "Penny", "Rajesh", "Howard" };
            long     n     = 7230702951;

            Assert.AreEqual("Leonard", DoubleCola.WhoIsNext(names, n));
        }
예제 #4
0
        public void InputNumberLowerThanOneShouldThrowException()
        {
            var action = new Action(() =>
            {
                DoubleCola.WhoIsNext(_names, 0);
            });

            action.Should().Throw <ArgumentException>();
        }
예제 #5
0
        public void InputNumberGreaterThanMaxValueShouldThrowException()
        {
            var action = new Action(() =>
            {
                var asdf = _names.Length * (long)Math.Pow(2, 61);
                DoubleCola.WhoIsNext(_names, asdf);
            });

            action.Should().Throw <ArgumentException>();
        }
예제 #6
0
 public void NextInLineShouldReturnCorrectPerson(string expected, long turn, params string[] queue)
 {
     AssertThatAreEqual(DoubleCola.WhoIsNext(queue, turn), expected);
 }
예제 #7
0
        public void Input7230702951ShouldReturnExpected()
        {
            var result = DoubleCola.WhoIsNext(_names, 7230702951);

            result.Should().Be("Leonard");
        }
예제 #8
0
        public void Input52ShouldReturnExpected()
        {
            var result = DoubleCola.WhoIsNext(_names, 52);

            result.Should().Be("Penny");
        }
예제 #9
0
        public void Input6ShouldReturnExpected()
        {
            var result = DoubleCola.WhoIsNext(_names, 6);

            result.Should().Be("Sheldon");
        }