Exemplo n.º 1
0
            public void When_DistributeDiskOverTowerTwoAndThree_ThenGameIsNotFinished()
            {
                var game = new Game(2);

                game.MoveDisk(game.Tower1, game.Tower2);
                game.MoveDisk(game.Tower1, game.Tower3);

                game.IsValid.Should().Be(true);
                game.IsFinished.Should().Be(false);
            }
Exemplo n.º 2
0
            public void When_MoveDisksOverEachOtherTwice_ThenGameIsFinished()
            {
                // this is a solution for 2 disks
                var game = new Game(2);

                game.MoveDisk(game.Tower1, game.Tower2);
                game.MoveDisk(game.Tower1, game.Tower3);
                game.MoveDisk(game.Tower2, game.Tower3);

                game.Tower1.Disks.Count.Should().Be(0);
                game.Tower2.Disks.Count.Should().Be(0);
                game.Tower3.Disks.Count.Should().Be(2);

                game.IsFinished.Should().Be(true);
            }
Exemplo n.º 3
0
            public void When_Move1_ThenDiskShouldMoveFromTower1ToTower2()
            {
                var game = new Game(2);

                game.MoveDisk(game.Tower1, game.Tower2);

                game.Tower1.Disks.Count.Should().Be(1);
                game.Tower2.Disks.Count.Should().Be(1);
                game.Tower3.Disks.Count.Should().Be(0);
            }