aboutsummaryrefslogtreecommitdiff
path: root/bidder/bid_test.go
blob: de6afd9415cb1a1d57bc71d35e89c29a0300ea47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package bidder

import (
	"testing"
)

func TestBitlengthTooLarge(t *testing.T) {
	bid, e := NewBid(0xFFFFFF, 70)
	if e == nil {
		t.Fatalf("failure expected, but got bid: %#v", bid)
	}
}

func TestPriceTooLarge(t *testing.T) {
	bid, e := NewBid(0xFFFFFF, 8)
	if e == nil {
		t.Fatalf("failure expected, but got bid: %#v", bid)
	}
}

func TestBidOK(t *testing.T) {
	bid, e := NewBid(102400, 24)
	if e != nil {
		t.Fatalf("unexpected error: %v", e)
	}
	t.Logf("Bid: %+v", bid)
}