Fallout 3 and Fallout: New Vegas hacker assistant
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
625B

  1. package main
  2. import (
  3. "fmt"
  4. "testing"
  5. "github.com/stretchr/testify/assert"
  6. "github.com/stretchr/testify/suite"
  7. )
  8. type GuessStringSuite struct {
  9. suite.Suite
  10. }
  11. func (suite *GuessStringSuite) TestNoCount() {
  12. t := suite.T()
  13. word := "chef"
  14. g := Guess{Word: word}
  15. s := g.String()
  16. assert.Equal(t, word, s)
  17. }
  18. func (suite *GuessStringSuite) TestCount() {
  19. t := suite.T()
  20. word := "chef"
  21. count := uint(2)
  22. g := Guess{Word: word, CorrectCount: &count}
  23. s := g.String()
  24. assert.Equal(t, fmt.Sprintf("%v %v", g.Word, *g.CorrectCount), s)
  25. }
  26. func TestGuessStringSuite(t *testing.T) {
  27. suite.Run(t, new(GuessStringSuite))
  28. }