Esempio n. 1
0
 public void Auction_FourPassesEndsAuction()
 {
     Auction auction = new Auction(CardinalDirection.North, Vurnability.None);
     auction.PlaceBid(_simplePass);
     auction.PlaceBid(_simplePass);
     auction.PlaceBid(_simplePass);
     auction.PlaceBid(_simplePass);
     Assert.IsTrue(auction.IsAuctionOver);
 }
Esempio n. 2
0
 public void Auction_BidAfterAuctionOverThrows()
 {
     Auction auction = new Auction(CardinalDirection.North, Vurnability.None);
     auction.PlaceBid(_simplePass);
     auction.PlaceBid(_simplePass);
     auction.PlaceBid(_simplePass);
     auction.PlaceBid(_simplePass);
     auction.PlaceBid(_simplePass);
 }
Esempio n. 3
0
        public void Auction_InvalidBidThrows()
        {
            Auction auction = new Auction(CardinalDirection.North, Vurnability.None);

            var heartBid = new BidTrumph(TrumphSuite.Hearts, 1);
            PlacedBid heartPlacedBid = new PlacedBid(heartBid,
                new List<BidMeaning>()
                {
                    new BidMeaning(13, 21, new List<SuiteTells>() {new SuiteTells(SuiteColor.Hearts, 4, 11)})
                });

            var clubBid = new BidTrumph(TrumphSuite.Clubs, 1);
            PlacedBid clubPlacedBid = new PlacedBid(heartBid,
                new List<BidMeaning>()
                {
                    new BidMeaning(13, 21, new List<SuiteTells>() {new SuiteTells(SuiteColor.Clubs, 4, 11)})
                });

            auction.PlaceBid(heartPlacedBid);
            auction.PlaceBid(clubPlacedBid);
        }
Esempio n. 4
0
        /// <summary>
        /// Creates a bid .
        /// </summary>
        /// <param name="auction">The auction.</param>
        /// <param name="myHand">My hand.</param>
        /// <returns></returns>
        public override PlacedBid CreateBid(Auction auction, Cards.IHand myHand)
        {
            if (auction == null)
            {
                throw new ArgumentNullException("auction");
            }

            if (myHand == null)
            {
                throw new ArgumentNullException("myHand");
            }

            if (myHand.Count != 13)
            {
                throw new InvalidOperationException("Invalid number of cards");
            }

            if(auction.LacksStartingBid)
            {
                return CreateStartBid(myHand);
            }

            throw new NotImplementedException();
        }
Esempio n. 5
0
 public void Auction_ThreePassesAuctionStillOpen()
 {
     Auction auction = new Auction(CardinalDirection.North, Vurnability.None);
     auction.PlaceBid(_simplePass);
     auction.PlaceBid(_simplePass);
     auction.PlaceBid(_simplePass);
     Assert.IsFalse(auction.IsAuctionOver);
 }
Esempio n. 6
0
 public void Auction_DealerStartsToBid()
 {
     Auction auction = new Auction(CardinalDirection.North, Vurnability.None);
     Assert.AreEqual(CardinalDirection.North, auction.TurnToBid);
 }
Esempio n. 7
0
 /// <summary>
 /// Creates the bid.
 /// </summary>
 /// <param name="auction">The auction.</param>
 /// <param name="myHand">My hand.</param>
 /// <returns></returns>
 public abstract PlacedBid CreateBid(Auction auction, IHand myHand);