Exemple #1
0
        public void TestNulProefWithValues()
        {
            //Arrange
            var game = new GameBuilder(this.Session).Build();

            scoreboard.AddGame(game);

            this.Session.Derive();

            var scores = game.Scores.ToArray();

            //Act
            scores[0].Value = -5;
            scores[1].Value = -5;
            scores[2].Value = 5;
            scores[3].Value = 5;

            //Assert
            Assert.True(scoreboard.NulProef());
        }
        public void TestMiserieWithOneDeclarerAndOneWinner()
        {
            //Arrange
            var game = new GameBuilder(this.Session).Build();

            scoreboard.AddGame(game);

            game.StartDate = this.Session.Now();
            game.EndDate   = game.StartDate.Value.AddHours(1);

            //Act
            game.GameType = this.GameTypes.MiserieOpTafel;
            game.AddDeclarer(player1);
            game.AddWinner(this.player1);

            this.Session.Derive();

            //Assert
            Assert.Equal(30, game.Scores.First(v => v.Player == player1).Value);
            Assert.Equal(-10, game.Scores.First(v => v.Player == player2).Value);
            Assert.Equal(-10, game.Scores.First(v => v.Player == player3).Value);
            Assert.Equal(-10, game.Scores.First(v => v.Player == player4).Value);
            Assert.True(this.scoreboard.NulProef());
        }
        public void TestSync()
        {
            //Arrange
            var game = new GameBuilder(this.Session).Build();

            //Act
            scoreboard.AddGame(game);
            this.Session.Derive();

            //Assert
            Assert.Equal(4, game.Scores.Count);
        }
Exemple #4
0
        public void TestAlleenGaanWithOneDeclarerAndNoWinnerAndNoTricks()
        {
            //Arrange
            var game = new GameBuilder(this.Session).Build();

            scoreboard.AddGame(game);

            game.StartDate = this.Session.Now();
            game.EndDate   = game.StartDate.Value.AddHours(1);

            //Act
            game.GameType = this.GameTypes.AlleenGaan;
            game.AddDeclarer(player1);

            this.Session.Derive();

            //Assert
            Assert.Equal(-6, game.Scores.First(v => v.Player == player1).Value);
            Assert.Equal(2, game.Scores.First(v => v.Player == player2).Value);
            Assert.Equal(2, game.Scores.First(v => v.Player == player3).Value);
            Assert.Equal(2, game.Scores.First(v => v.Player == player4).Value);
            Assert.True(this.scoreboard.NulProef());
        }