Documentation
¶
Index ¶
- Constants
- func Alerter(duration time.Duration, amount int, to io.Writer)
- func AssertContentType(t testing.TB, response *httptest.ResponseRecorder, want string)
- func AssertFinishCalledWith(t testing.TB, game *GameSpy, winner string)
- func AssertGameNotStarted(t testing.TB, game *GameSpy)
- func AssertGameStartedWith(t testing.TB, game *GameSpy, numberOfPlayers int)
- func AssertLeague(t testing.TB, got, want []Player)
- func AssertMessagesSentToUser(t testing.TB, stdout *bytes.Buffer, messages ...string)
- func AssertNoError(t testing.TB, err error)
- func AssertPlayerWin(t testing.TB, store *StubPlayerStore, winner string)
- func AssertResponseBody(t testing.TB, got, want string)
- func AssertScheduledAlert(t testing.TB, got, want ScheduledAlert)
- func AssertScoreEquals(t testing.TB, got, want int)
- func AssertStatus(t testing.TB, got *httptest.ResponseRecorder, want int)
- func CreateTempFile(t testing.TB, initialData string) (*os.File, func())
- func NewGetScoreRequest(name string) *http.Request
- func NewLeagueRequest() *http.Request
- func NewPostWinRequest(name string) *http.Request
- type BlindAlerter
- type BlindAlerterFunc
- type CLI
- type FileSystemPlayerStore
- type Game
- type GameSpy
- type League
- type Player
- type PlayerServer
- type PlayerStore
- type ScheduledAlert
- type SpyBlindAlerter
- type StubPlayerStore
- type TexasHoldem
Constants ¶
View Source
const BadPlayerInputErrMsg = "Bad value received for number of players, please try again with a number"
View Source
const PlayerPrompt = "Please enter the number of players: "
Variables ¶
This section is empty.
Functions ¶
func AssertContentType ¶
func AssertContentType(t testing.TB, response *httptest.ResponseRecorder, want string)
func AssertFinishCalledWith ¶
func AssertGameNotStarted ¶
func AssertGameStartedWith ¶
func AssertLeague ¶
func AssertNoError ¶
func AssertPlayerWin ¶
func AssertPlayerWin(t testing.TB, store *StubPlayerStore, winner string)
func AssertResponseBody ¶
func AssertScheduledAlert ¶
func AssertScheduledAlert(t testing.TB, got, want ScheduledAlert)
func AssertScoreEquals ¶
func AssertStatus ¶
func AssertStatus(t testing.TB, got *httptest.ResponseRecorder, want int)
func NewGetScoreRequest ¶
func NewLeagueRequest ¶
func NewPostWinRequest ¶
Types ¶
type BlindAlerter ¶
type BlindAlerterFunc ¶
func (BlindAlerterFunc) ScheduleAlertAt ¶
type FileSystemPlayerStore ¶
type FileSystemPlayerStore struct {
// contains filtered or unexported fields
}
func FileSystemPlayerStoreFromFile ¶
func FileSystemPlayerStoreFromFile(path string) (*FileSystemPlayerStore, func(), error)
func NewFileSystemStore ¶
func NewFileSystemStore(file *os.File) (*FileSystemPlayerStore, error)
func (*FileSystemPlayerStore) GetLeague ¶
func (f *FileSystemPlayerStore) GetLeague() League
func (*FileSystemPlayerStore) GetPlayerScore ¶
func (f *FileSystemPlayerStore) GetPlayerScore(name string) int
func (*FileSystemPlayerStore) RecordWin ¶
func (f *FileSystemPlayerStore) RecordWin(name string)
type GameSpy ¶
type Player ¶
func GetLeagueFromResponse ¶
type PlayerServer ¶
func NewPlayerServer ¶
func NewPlayerServer(store PlayerStore, game Game) (*PlayerServer, error)
type PlayerStore ¶
type ScheduledAlert ¶
func (ScheduledAlert) String ¶
func (s ScheduledAlert) String() string
type SpyBlindAlerter ¶
type SpyBlindAlerter struct {
Alerts []ScheduledAlert
}
func (*SpyBlindAlerter) ScheduleAlertAt ¶
type StubPlayerStore ¶
type StubPlayerStore struct {
// contains filtered or unexported fields
}
func (*StubPlayerStore) GetLeague ¶
func (s *StubPlayerStore) GetLeague() League
func (*StubPlayerStore) GetPlayerScore ¶
func (s *StubPlayerStore) GetPlayerScore(name string) int
func (*StubPlayerStore) RecordWin ¶
func (s *StubPlayerStore) RecordWin(name string)
type TexasHoldem ¶
type TexasHoldem struct {
// contains filtered or unexported fields
}
func NewGame ¶
func NewGame(alerter BlindAlerter, store PlayerStore) *TexasHoldem
func (*TexasHoldem) Finish ¶
func (p *TexasHoldem) Finish(winner string)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.