public static string GetStateText(SniperState state) { if (state == SniperState.JOINING) { return(STATUS_JOINING); } if (state == SniperState.BIDDING) { return(STATUS_BIDDING); } if (state == SniperState.WINNING) { return(STATUS_WINNING); } if (state == SniperState.WON) { return(STATUS_WON); } if (state == SniperState.LOSING) { return(STATUS_LOSING); } if (state == SniperState.FAILED) { return(STATUS_FAILED); } return(STATUS_LOST); }
public SniperSnapshot(string itemId, int lastPrice, int lastBid, SniperState state) { this.ItemId = itemId; this.LastPrice = lastPrice; this.LastBid = lastBid; this.State = state; }
public SniperSnapshot(string itemId, int lastPrice, int lastBid, SniperState sniperState) { State = sniperState; ItemId = itemId; LastPrice = lastPrice; LastBid = lastBid; }
public SniperSnapshot(string itemId, int lastPrice, int lastBid, SniperState state) { _itemId = itemId; _lastPrice = lastPrice; _lastBid = lastBid; _state = state; }
public static SniperState WhenAuctionClosed(this SniperState state) { switch (state) { case SniperState.Joining: case SniperState.Bidding: case SniperState.Losing: return(SniperState.Lost); case SniperState.Winning: return(SniperState.Won); default: throw new DefectException("Auction is already closed"); } }
private SniperSnapshot(int lastPrice, int lastBid, SniperState state) { LastPrice = lastPrice; LastBid = lastBid; State = state; }
public static SniperSnapshot HasState(this IArgumentConstraintManager<SniperSnapshot> iacm, SniperState state) { return iacm.Matches(ss => ss.State == state); }
public static SniperSnapshot HasState(this IArgumentConstraintManager <SniperSnapshot> iacm, SniperState state) { return(iacm.Matches(ss => ss.State == state)); }
public static void StateShouldBe(this AuctionSniper sniper, SniperState state, int lastPrice, int lastBid) { sniper.Snapshot.State.ShouldEqual(state); sniper.Snapshot.LastPrice.ShouldEqual(lastPrice); sniper.Snapshot.LastBid.ShouldEqual(lastBid); }
public static string TextFor(SniperState state) { return(StatusText[(int)state]); }
public static string TextFor(SniperState state) { return(TableItem.TextFor(state)); }