package bot import "testing" func TestPhraseString(t *testing.T) { passTests := []struct { val Phrase // test value exp string // expected string } {{ val: Phrase { Verb: 0, Noun: 0, }, exp: "actualize action items", }, { val: Phrase { HasAdverb: true, Adverb: 1, Verb: 2, Noun: 3, }, exp: "assertively aggregate architectures", }, { val: Phrase { HasAdverb: true, Adverb: 2, Verb: 3, Adjectives: []int { 4 }, Noun: 5, }, exp: "authoritatively architect alternative benefits", }, { val: Phrase { HasAdverb: true, Adverb: 3, Verb: 4, Adjectives: []int { 5, 6 }, Noun: 7, }, exp: "collaboratively benchmark an expanded array of and B2B catalysts for change", }, { val: Phrase { HasAdverb: true, Adverb: 4, Verb: 5, Adjectives: []int { 6, 7, 8 }, Noun: 9, }, exp: "compellingly brand B2B, B2C, and backend clouds", }} for _, test := range(passTests) { t.Run(test.exp, func(t *testing.T) { got := test.val.String() if got != test.exp { t.Fatalf("got \"%s\", exp \"%s\"", got, test.exp) } }) } } func TestSentenceString(t *testing.T) { passTests := []struct { val Sentence // test value exp string // expected string } {{ val: Sentence{ Phrases: []Phrase{ Phrase { Verb: 0, Noun: 0, }, }, }, exp: "actualize action items", }, { val: Sentence { Phrases: []Phrase { Phrase { Verb: 0, Noun: 0, }, Phrase { HasAdverb: true, Adverb: 1, Verb: 2, Noun: 3, }, }, Joins: []int { 0 }, }, exp: "actualize action items for assertively aggregate architectures", }} for _, test := range(passTests) { t.Run(test.exp, func(t *testing.T) { got := test.val.String() if got != test.exp { t.Fatalf("got \"%s\", exp \"%s\"", got, test.exp) } }) } }