12345678910111213141516171819202122232425262728293031323334353637383940 |
- package main
- import (
- "fmt"
- "github.com/stretchr/testify/assert"
- "testing"
- )
- func TestSimulation_Run(t *testing.T) {
- type fields struct {
- Game *Game
- }
- tests := []struct {
- name string
- fields fields
- wantErr assert.ErrorAssertionFunc
- }{
- {
- name: "simple words",
- fields: fields{
- Game: &Game{
- Words: map[string]*Word{
- "aaa": {Word: "aaa"},
- "aab": {Word: "aab"},
- "abb": {Word: "abb"},
- },
- },
- },
- wantErr: assert.NoError,
- },
- }
- for _, tt := range tests {
- t.Run(tt.name, func(t *testing.T) {
- s := Simulation{
- Game: tt.fields.Game,
- }
- tt.wantErr(t, s.SimulateAllPossibleGames(), fmt.Sprintf("SimulateAllPossibleGames()"))
- })
- }
- }
|