Skip to content
Snippets Groups Projects
AuctionManagerFixture.java 778 B
Newer Older
package fitNesseFixture;
cristiano's avatar
cristiano committed
import exceptions.BidBelowZeroException;
import exceptions.BidNullException;
import project.AuctionManager;
cristiano's avatar
cristiano committed
import project.User;
public class AuctionManagerFixture {
	private AuctionManager ab;
cristiano's avatar
cristiano committed
	private int usr;
	private Integer value = null;
	
	public AuctionManagerFixture(int usr) {
		User user = new User(usr);
		this.usr = usr;
	}
	
cristiano's avatar
cristiano committed
	public String placeBid() {
			
		ab = AuctionManager.getInstance();
cristiano's avatar
cristiano committed
		try {
			if(ab.placeBid(usr, value)) {
				return "Bid placed!";
			}
		} catch (BidBelowZeroException e) {
			return e.getMessage();
		} catch (BidNullException e) {
			return e.getMessage();
		}	
		return null;
	public void setValue(int value) {
		this.value = value;
	}

	public void setAb(AuctionManager ab) {