private static void SetUpMock(out TransferMarket market, out Club manchester, out Club barcelona)
        {
            market = new TransferMarket();
            market.TradePercent   = 20;
            market.MaxPlayerTrade = 2;
            market.MinPlayerTrade = 1;

            manchester = new Club()
            {
                Id = 1, Name = "Manchester United", Money = 5000
            };
            barcelona = new Club()
            {
                Id = 2, Name = "Barcelona", Money = 5000
            };

            var messi = new PlayerTradable()
            {
                Id = 1, Price = 5000, Name = "Lionel Messi"
            };
            var neymar = new PlayerTradable()
            {
                Id = 3, Price = 4000, Name = "Neymar Jr"
            };
            var suarez = new PlayerTradable()
            {
                Id = 5, Price = 4000, Name = "Suarez"
            };

            barcelona.AddPlayer(messi);
            barcelona.AddPlayer(neymar);
            barcelona.AddPlayer(suarez);


            var aguero = new PlayerTradable()
            {
                Id = 2, Price = 2200, Name = "Aguero"
            };
            var toure = new PlayerTradable()
            {
                Id = 4, Price = 1800, Name = "Toure"
            };

            manchester.AddPlayer(aguero);
            manchester.AddPlayer(toure);
        }
Beispiel #2
0
        public void Club_Must_Have_Player()
        {
            var player = new PlayerTradable()
            {
                Id = 1
            };
            var club = new Club();

            club.AddPlayer(player);

            var validator = new ClubMustHavePlayer(club, player);

            Assert.IsTrue(validator.Validate());
        }