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); }
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); }
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); }
/// <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(); }
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); }
public void Auction_DealerStartsToBid() { Auction auction = new Auction(CardinalDirection.North, Vurnability.None); Assert.AreEqual(CardinalDirection.North, auction.TurnToBid); }
/// <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);