You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
839 B
34 lines
839 B
package dao |
|
|
|
import ( |
|
"context" |
|
"testing" |
|
|
|
. "github.com/smartystreets/goconvey/convey" |
|
) |
|
|
|
func Test_UpperPassed(t *testing.T) { |
|
Convey("get data", t, WithMysql(func(d *Dao) { |
|
aids, err := d.UpperPassed(context.TODO(), dataMID) |
|
So(err, ShouldBeNil) |
|
So(aids, ShouldNotBeEmpty) |
|
})) |
|
Convey("no data", t, WithMysql(func(d *Dao) { |
|
aids, err := d.UpperPassed(context.TODO(), noDataMID) |
|
So(err, ShouldBeNil) |
|
So(aids, ShouldBeEmpty) |
|
})) |
|
} |
|
|
|
func Test_UppersPassed(t *testing.T) { |
|
Convey("get data", t, WithMysql(func(d *Dao) { |
|
arts, err := d.UppersPassed(context.TODO(), []int64{dataMID}) |
|
So(err, ShouldBeNil) |
|
So(arts, ShouldNotBeEmpty) |
|
})) |
|
Convey("no data", t, WithMysql(func(d *Dao) { |
|
arts, err := d.UppersPassed(context.TODO(), []int64{noDataMID}) |
|
So(err, ShouldBeNil) |
|
So(arts[noDataMID], ShouldBeEmpty) |
|
})) |
|
}
|
|
|