archive_test.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package service
  2. import (
  3. "context"
  4. "testing"
  5. "go-common/app/admin/main/esports/model"
  6. . "github.com/smartystreets/goconvey/convey"
  7. )
  8. func TestService_arcRelationChanges(t *testing.T) {
  9. Convey("test arc relation", t, WithService(func(s *Service) {
  10. arg := &model.ArcImportParam{
  11. Aid: 2147483647,
  12. Gids: []int64{2, 3, 5},
  13. MatchIDs: []int64{91},
  14. TeamIDs: []int64{2, 3, 4},
  15. TagIDs: []int64{2, 4},
  16. Years: []int64{1986, 2003},
  17. }
  18. data, err := s.arcRelationChanges(context.Background(), arg, _typeEdit)
  19. So(err, ShouldBeNil)
  20. for _, v := range data.AddTeams {
  21. Printf("Add %+v \n", v)
  22. }
  23. for _, v := range data.UpAddTeams {
  24. Printf("upAdd %+v \n", v)
  25. }
  26. for _, v := range data.UpDelTeams {
  27. Printf("upDel %+v \n", v)
  28. }
  29. }))
  30. }
  31. func TestService_BatchAddArc(t *testing.T) {
  32. Convey("test batch add arc", t, WithService(func(s *Service) {
  33. arg := &model.ArcAddParam{
  34. Aids: []int64{44444444, 55555555},
  35. Gids: []int64{6},
  36. MatchIDs: []int64{31},
  37. TeamIDs: []int64{3, 2},
  38. TagIDs: []int64{3},
  39. Years: []int64{2017, 2018},
  40. }
  41. err := s.BatchAddArc(context.Background(), arg)
  42. So(err, ShouldBeNil)
  43. }))
  44. }