Fixing bug in url query reader and added test cases

This commit is contained in:
tariq1890
2018-08-05 13:54:06 -07:00
parent 6f1b125c48
commit e8dfbe94b1
3 changed files with 50 additions and 1 deletions

View File

@ -0,0 +1,22 @@
package util
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestIsEmail(t *testing.T) {
Convey("When validating a string that is a valid email", t, func() {
result := IsEmail("abc@def.com")
So(result, ShouldEqual, true)
})
Convey("When validating a string that is not a valid email", t, func() {
result := IsEmail("abcdef.com")
So(result, ShouldEqual, false)
})
}