Example #1
0
        public void CalculateLabelsAfterCupOneCorrectly(int moves, string expectedOrder)
        {
            var sut = new CupGame(SAMPLE_DATA_2);

            sut.Moves(moves);
            Assert.Equal(expectedOrder, sut.GetLabelsAfterCupOne());
        }
Example #2
0
        public void SolveFirstPuzzle()
        {
            var sut = new CupGame(PUZZLE_DATA);

            sut.Moves(100);
            Assert.Equal("97624853", sut.GetLabelsAfterCupOne());
        }
Example #3
0
        public void SolveSecondPuzzle()
        {
            var sut = new CupGame(PUZZLE_DATA, 1000000);

            sut.Moves(10000000);
            Assert.Equal(776819, sut.FirstNumberAfterOne);
            Assert.Equal(855595, sut.SecondNumberAfterOne);
            Assert.Equal(664642452305UL, sut.MultiplyFirstAndSecondNumberAfterOne);
        }
Example #4
0
        public void SolveSecondPuzzle_WhenUsingSampleData()
        {
            var sut = new CupGame(SAMPLE_DATA_2, 1000000);

            sut.Moves(10000000);
            Assert.Equal(934001, sut.FirstNumberAfterOne);
            Assert.Equal(159792, sut.SecondNumberAfterOne);
            Assert.Equal(149245887792UL, sut.MultiplyFirstAndSecondNumberAfterOne);
        }
Example #5
0
        public void ExecuteTenMovesCorrectly()
        {
            var sut = new CupGame(SAMPLE_DATA_2);

            sut.Moves(10);
            Assert.Collection(sut.GetCupsInOrder(),
                              c1 => Assert.Equal(5, c1),
                              c2 => Assert.Equal(8, c2),
                              c3 => Assert.Equal(3, c3),
                              c4 => Assert.Equal(7, c4),
                              c5 => Assert.Equal(4, c5),
                              c6 => Assert.Equal(1, c6),
                              c7 => Assert.Equal(9, c7),
                              c8 => Assert.Equal(2, c8),
                              c9 => Assert.Equal(6, c9));
        }