示例#1
0
        public void Setup()
        {
            gameRepo   = new LiteGameRepository(connectionString);
            playerRepo = new LitePlayerRepository(connectionString);
            player1    = DatabaseHandler.GetArbitraryPlayer("1");;
            player2    = DatabaseHandler.GetArbitraryPlayer("2");;
            player3    = DatabaseHandler.GetArbitraryPlayer("3");;
            player4    = DatabaseHandler.GetArbitraryPlayer("4");;

            player1 = playerRepo.Add(player1);
            player2 = playerRepo.Add(player2);
            player3 = playerRepo.Add(player3);
            player4 = playerRepo.Add(player4);

            game = new Game
            {
                RedScore    = 10,
                BlueScore   = 9,
                BlueOffense = player1.ID,
                BlueDefense = player2.ID,
                RedOffense  = player3.ID,
                RedDefense  = player4.ID
            };

            game = gameRepo.Add(game);
        }
        public void Setup()
        {
            gameRepo   = new LiteGameRepository(connectionString);
            playerRepo = new LitePlayerRepository(connectionString);
            player1    = DatabaseHandler.GetArbitraryPlayer("1");;
            player2    = DatabaseHandler.GetArbitraryPlayer("2");;
            player3    = DatabaseHandler.GetArbitraryPlayer("3");;
            player4    = DatabaseHandler.GetArbitraryPlayer("4");;

            player1 = playerRepo.Add(player1);
            player2 = playerRepo.Add(player2);
            player3 = playerRepo.Add(player3);
            player4 = playerRepo.Add(player4);

            game = new Game
            {
                RedScore    = 10,
                BlueScore   = 9,
                BlueOffense = player1.ID,
                BlueDefense = player2.ID,
                RedOffense  = player3.ID,
                RedDefense  = player4.ID
            };


            player1.GamesPlayed  = 1;
            player1.GamesLost    = 1;
            player1.GamesWon     = 0;
            player1.GoalsAgainst = 10;
            player1.GoalsFor     = 9;

            player2.GamesPlayed  = 1;
            player2.GamesLost    = 1;
            player2.GamesWon     = 0;
            player2.GoalsAgainst = 10;
            player2.GoalsFor     = 9;


            player3.GamesPlayed  = 1;
            player3.GamesLost    = 0;
            player3.GamesWon     = 1;
            player3.GoalsAgainst = 9;
            player3.GoalsFor     = 10;

            player4.GamesPlayed  = 1;
            player4.GamesLost    = 0;
            player4.GamesWon     = 1;
            player4.GoalsAgainst = 9;
            player4.GoalsFor     = 10;
        }