addit_test.go 947 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package archive
  2. import (
  3. "context"
  4. . "github.com/smartystreets/goconvey/convey"
  5. "testing"
  6. )
  7. func TestAddit(t *testing.T) {
  8. Convey("test archive", t, WithDao(func(d *Dao) {
  9. aid := int64(10098814)
  10. a, err := d.Addit(context.Background(), aid)
  11. So(err, ShouldBeNil)
  12. So(a, ShouldNotBeNil)
  13. }))
  14. }
  15. func TestUpAdditRedirect(t *testing.T) {
  16. Convey("UpAdditRedirect", t, WithDao(func(d *Dao) {
  17. var c = context.TODO()
  18. tx, _ := d.BeginTran(c)
  19. _, err := d.TxUpAdditRedirect(tx, 0, "")
  20. tx.Commit()
  21. So(err, ShouldBeNil)
  22. }))
  23. }
  24. func TestTxUpAddit(t *testing.T) {
  25. Convey("TxUpAddit", t, WithDao(func(d *Dao) {
  26. var c = context.TODO()
  27. tx, _ := d.BeginTran(c)
  28. _, err := d.TxUpAddit(tx, 0, 0, "", "", "")
  29. tx.Commit()
  30. So(err, ShouldBeNil)
  31. }))
  32. }
  33. func TestAdditBatch(t *testing.T) {
  34. Convey("AdditBatch", t, WithDao(func(d *Dao) {
  35. var c = context.TODO()
  36. _, err := d.AdditBatch(c, []int64{1, 2, 3})
  37. So(err, ShouldBeNil)
  38. }))
  39. }