Initial cloud-services repo - gateway service + pkg modules
This commit is contained in:
20
pkg/db/queries/rate_plan_tomobile_test.go
Normal file
20
pkg/db/queries/rate_plan_tomobile_test.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package queries_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
m "fiskerinc.com/modules/common"
|
||||
"fiskerinc.com/modules/db/queries"
|
||||
)
|
||||
|
||||
func TestCreateSelectQuery(t *testing.T) {
|
||||
ratePlanDB := queries.RatePlanTmobile{}
|
||||
ratePlanModel := []m.RatePlanTMobile{}
|
||||
|
||||
q := ratePlanDB.CreateSelectQuery("US", &ratePlanModel)
|
||||
q_str := queryToString(q)
|
||||
expected := `SELECT "r"."country", "r"."product_id", "r"."plan_name", "r"."created_at", "r"."updated_at" FROM "rate_plan_tmobile" AS "r" WHERE (country = 'US')`
|
||||
if q_str != expected {
|
||||
t.Errorf("Expected the query string %s, but got %s.", expected, q_str)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user