Exemplo n.º 1
0
 public void StartBiddingIn(FakeAuctionServer inAuction)
 {
     mDriver = new ConsoleAuctionSniperDriver(
         inAuction.HostName, SniperId, SniperPassword,
         inAuction.ItemId,
         1000
     );
     mDriver.ShowSniperStatus(SniperStatus.Joining);
 }
Exemplo n.º 2
0
 public void StartBiddingIn(FakeAuctionServer inAuction)
 {
     mDriver = new ConsoleAuctionSniperDriver(
         inAuction.HostName, SniperId, SniperPassword,
         inAuction.ItemId,
         1000
         );
     mDriver.ShowSniperStatus(SniperStatus.Joining);
 }
        public void SniperLosesAnAuctionWhenThePriceIsTooHigh()
        {
            auction = new FakeAuctionServer(new Item("item-54321", 1100));
            auction.StartSellingItem();

            application.StartBiddingWithStopPrice(1100, auction);
            auction.HasReceivedJoinRequestFromSniper(ApplicationRunner.SNIPER_XMPP_ID);

            auction.ReportPrice(1000, 98, "other bidder");
            application.HasShownSniperIsBidding(auction, 1000, 1098);

            auction.HasReceivedBid(1098, ApplicationRunner.SNIPER_XMPP_ID);

            auction.ReportPrice(1197, 10, "third party");
            application.HasShownSniperIsLosing(auction, 1197, 1098);

            auction.ReportPrice(1207, 10, "fourth party");
            application.HasShownSniperIsLosing(auction, 1207, 1098);

            auction.AnnounceClosed();
            application.ShowsSniperHasLostAuction(auction, 1207, 1098);
        }
 public void SetUp()
 {
     mAuction = new FakeAuctionServer("item-54321");
     mRunner  = new ApplicationRunner();
 }
 public void SetUp()
 {
     mAuction = new FakeAuctionServer("item-54321");
     mRunner = new ApplicationRunner();
 }
 public void Setup()
 {
     auction     = new FakeAuctionServer(new Item("item-54321", Int32.MaxValue));
     auction2    = new FakeAuctionServer(new Item("item-65432", Int32.MaxValue));
     application = new ApplicationRunner();
 }
Exemplo n.º 7
0
 internal void ReportsInvalidMessage(FakeAuctionServer auction, string brokenMessage)
 {
     logDriver.HasEntry(brokenMessage);
 }
Exemplo n.º 8
0
 internal void ShowsSniperHasLostAuction(FakeAuctionServer auction, int lastPrice, int lastBid)
 {
     driver.ShowsSniperStatus(auction.Item, lastPrice, lastBid, Status.STATUS_LOST);
 }
Exemplo n.º 9
0
 internal void HasShownSniperIsLosing(FakeAuctionServer auction, int lastPrice, int lastBid)
 {
     driver.ShowsSniperStatus(auction.Item, lastPrice, lastBid, Status.STATUS_LOSING);
 }
Exemplo n.º 10
0
 internal void HasShownSniperIsWinning(FakeAuctionServer auction, int winningBid)
 {
     driver.ShowsSniperStatus(auction.Item, winningBid, winningBid, Status.STATUS_WINNING);
 }
Exemplo n.º 11
0
 internal void ShowSniperHasWonAuction(FakeAuctionServer auction, int lastPrice)
 {
     driver.ShowsSniperStatus(auction.Item, lastPrice, lastPrice, Status.STATUS_WON);
 }
Exemplo n.º 12
0
 internal void ShowsSniperHasFailed(FakeAuctionServer auction)
 {
     driver.ShowsSniperStatus(auction.Item, 0, 0, Status.STATUS_FAILED);
 }