Package org.gnubridge.core.bidding

Examples of org.gnubridge.core.bidding.Auctioneer


    };
    assertEquals(new Bid(7, NoTrump.i()), rule.getBid());
  }

  public void testPrepareBidInRebidSituation2() {
    Auctioneer a = new Auctioneer(West.i());
    a.bid(PASS);
    a.bid(ONE_CLUBS);
    a.bid(PASS);
    a.bid(ONE_DIAMONDS);
    a.bid(PASS);

    Rebid rule = new Rebid(a, new Hand("3,2", "K,Q,J,2", "9,8", "A,K,5,4,3")) {
      @Override
      protected Bid prepareBid() {
        return new Bid(7, NoTrump.i());
View Full Code Here


    };
    assertEquals(new Bid(7, NoTrump.i()), rule.getBid());
  }

  public void testPrepareBidInRebidSituation3() {
    Auctioneer a = new Auctioneer(West.i());
    a.bid(PASS);
    a.bid(PASS);
    a.bid(ONE_CLUBS);
    a.bid(PASS);
    a.bid(ONE_DIAMONDS);
    a.bid(PASS);

    Rebid rule = new Rebid(a, new Hand("3,2", "K,Q,J,2", "9,8", "A,K,5,4,3")) {
      @Override
      protected Bid prepareBid() {
        return new Bid(7, NoTrump.i());
View Full Code Here

    };
    assertEquals(new Bid(7, NoTrump.i()), rule.getBid());
  }

  public void testPrepareBidInRebidSituation4() {
    Auctioneer a = new Auctioneer(West.i());
    a.bid(PASS);
    a.bid(PASS);
    a.bid(PASS);
    a.bid(ONE_CLUBS);
    a.bid(PASS);
    a.bid(ONE_DIAMONDS);
    a.bid(PASS);

    Rebid rule = new Rebid(a, new Hand("3,2", "K,Q,J,2", "9,8", "A,K,5,4,3")) {
      @Override
      protected Bid prepareBid() {
        return new Bid(7, NoTrump.i());
View Full Code Here

    };
    assertEquals(new Bid(7, NoTrump.i()), rule.getBid());
  }

  public void testDoNotThrowNPEPartnerPass() {
    Auctioneer a = new Auctioneer(West.i());
    a.bid(PASS);
    a.bid(PASS);
    Rebid rule = new Rebid(a, new Hand("3,2", "K,Q,J,2", "9,8", "A,K,5,4,3")) {
      @Override
      protected Bid prepareBid() {
        return null;
      }
View Full Code Here

    };
    assertEquals(null, rule.getBid());
  }

  public void testDoNotThrowNPEPartnerDidNotBid() {
    Auctioneer a = new Auctioneer(West.i());
    a.bid(PASS);
    Rebid rule = new Rebid(a, new Hand("3,2", "K,Q,J,2", "9,8", "A,K,5,4,3")) {
      @Override
      protected Bid prepareBid() {
        return null;
      }
View Full Code Here

    };
    assertEquals(null, rule.getBid());
  }

  public void testDoNotApplyWhenPartnerDoubled() {
    Auctioneer a = new Auctioneer(West.i());
    a.bid(ONE_CLUBS);
    a.bid(PASS);
    a.bid(DOUBLE);
    a.bid(PASS);
    Rebid rule = new Rebid(a, new Hand("3,2", "K,Q,J,2", "9,8", "A,K,5,4,3")) {
      @Override
      protected Bid prepareBid() {
        throw new RuntimeException("should not try to prepare bid when it's not a rebid situation");
      }
View Full Code Here

    };
    assertEquals(null, rule.getBid());
  }

  public void testDoNotApplyWhenIDoubled() {
    Auctioneer a = new Auctioneer(West.i());
    a.bid(ONE_CLUBS);
    a.bid(DOUBLE);
    a.bid(PASS);
    a.bid(ONE_DIAMONDS);
    a.bid(PASS);
    Rebid rule = new Rebid(a, new Hand("3,2", "K,Q,J,2", "9,8", "A,K,5,4,3")) {
      @Override
      protected Bid prepareBid() {
        throw new RuntimeException("should not try to prepare bid when it's not a rebid situation");
      }
View Full Code Here

public class Respond1NTTest extends TestCase {
  Auctioneer a;

  @Override
  protected void setUp() {
    a = new Auctioneer(West.i());
    a.bid(ONE_NOTRUMP);
    a.bid(PASS);
  }
View Full Code Here

    Respond1NT triangulate = new Respond1NT(a, new Hand("A,3", "9,8,7,6,2", "K,5,3", "Q,4,3"));
    assertEquals(THREE_HEARTS, triangulate.getBid());
  }

  public void testDoNotFireWhenNotRespondingTo1NT() {
    Auctioneer not1NT = new Auctioneer(West.i());
    Respond1NT rule = new Respond1NT(not1NT, new Hand("9,8,7,6,2", "A,3", "6,5,3", "Q,4,3"));
    assertNull(rule.getBid());
  }
View Full Code Here

    Respond1NT rule = new Respond1NT(a, new Hand("K,8,7,6", "A,3,2", "A,J,3", "Q,4,3"));
    assertEquals(THREE_NOTRUMP, rule.getBid());
  }

  public void testAlsoAppliesToOvercalls() {
    a = new Auctioneer(West.i());
    a.bid(ONE_CLUBS);
    a.bid(ONE_NOTRUMP);
    a.bid(PASS);
    Respond1NT rule = new Respond1NT(a, new Hand("9,8,7,6,2", "A,3", "6,5,3", "Q,4,3"));
    assertEquals(TWO_SPADES, rule.getBid());
View Full Code Here

TOP

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

Copyright © 2018 www.massapicom. 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.