diff options
Diffstat (limited to 'bot/bot_test.go')
-rw-r--r-- | bot/bot_test.go | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/bot/bot_test.go b/bot/bot_test.go new file mode 100644 index 0000000..122614f --- /dev/null +++ b/bot/bot_test.go @@ -0,0 +1,104 @@ +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) + } + }) + } +} |