public AuctionScenariosSteps() { _me = Buyers.Single(buyer => buyer.Name == "Thiago Lunardi"); _auctionRoom = Rooms.Single(room => room.RoomNumber == 7); _startingBid = _auctionRoom.NextPrice(); var attendants = Buyers.Where(b => b.Name != _me.Name).ToList(); attendants.ForEach(a => _auctionRoom.TryEnterAsAttendant(a)); _previousBids = attendants.Select(a => a.CreateBid(_auctionRoom, _startingBid, BidType.Online)); Thread.Sleep(500); // To be clear that any bid after here will be a lazy bid }
public void ThenMyBidWasPlacedFirst() { var success = _auctionRoom.TryPlaceBid(_myBid); Assert.IsTrue(success); Thread.Sleep(500); // To be clear that any bid after here will be a lazy bid var lazyBids = Buyers.Where(b => b.Name != _me.Name).Select(a => a.CreateBid(_auctionRoom, _startingBid, BidType.Online)); foreach (var bid in lazyBids) { success = _auctionRoom.TryPlaceBid(bid); Assert.IsTrue(success); } }
public void Fill() { FillMainData(); Checks = _dataSet.Tables[0].AsEnumerable().Select(dataRow => new Check { Id = dataRow.Field <long>("Id"), Number = dataRow.Field <string>("Number"), Date = dataRow.Field <DateTime>("Date"), Buyer = Buyers.Where(b => b.Id == dataRow.Field <long>("BuyerFk")).Single(), Seller = Sellers.Where(s => s.Id == dataRow.Field <long>("SellerFk")).Single(), Fridge = Fridges.Where(f => f.Id == dataRow.Field <long>("FridgeFk")).Single() }).ToList(); _dataSet.Clear(); }