Package org.gnubridge.core.bidding

Source Code of org.gnubridge.core.bidding.BiddingAgentTestCase

package org.gnubridge.core.bidding;

import static org.gnubridge.core.Direction.*;
import junit.framework.TestCase;

import org.gnubridge.core.Hand;

public abstract class BiddingAgentTestCase extends TestCase {
  Auctioneer auctioneer;
  BiddingAgent agent;

  protected void expectPlayerToBid(Bid bid) {
    assertEquals(bid, agent.getBid());

  }

  protected void andPlayersCards(String... cardsBySuits) {
    agent = new BiddingAgent(auctioneer, new Hand(cardsBySuits));

  }

  protected void givenPlayersCards(String... cardsBySuits) {
    givenNoPriorBids();
    agent = new BiddingAgent(auctioneer, new Hand(cardsBySuits));

  }

  protected void givenNoPriorBids() {
    auctioneer = new Auctioneer(WEST);

  }

  protected void givenBidding(Bid... bids) {
    givenNoPriorBids();
    for (Bid bid : bids) {
      auctioneer.bid(bid);
    }

  }
}
TOP

Related Classes of org.gnubridge.core.bidding.BiddingAgentTestCase

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.