Basic Testing & Cleanup

This commit is contained in:
2022-10-27 03:54:44 +00:00
parent 810d971567
commit d8ca637c7d
3 changed files with 50 additions and 3 deletions

27
app/event_test.go Normal file
View File

@ -0,0 +1,27 @@
package app
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestGetChannelName(t *testing.T) {
assert := assert.New(t)
event := Event{
Name: "Hello World",
Location: "1234 Place Rd, Ann Arbor, MI 00000",
DateTime: time.Date(2022, time.January, 5, 0, 0, 0, 0, time.UTC),
}
assert.Equal("jan-5-ann-arbor-hello-world", event.GetChannelName())
event = Event{
Name: "Hello World",
Location: "Michigan Theater, Ann Arbor",
DateTime: time.Date(2022, time.January, 5, 0, 0, 0, 0, time.UTC),
}
assert.Equal("jan-5-hello-world", event.GetChannelName())
}