jury_test.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. package service
  2. import (
  3. "context"
  4. "fmt"
  5. "testing"
  6. "go-common/app/admin/main/credit/model/blocked"
  7. . "github.com/smartystreets/goconvey/convey"
  8. )
  9. func Test_SetCaseConf(t *testing.T) {
  10. Convey("return someting", t, func() {
  11. cc := new(blocked.ArgCaseConf)
  12. cc.CaseCheckHours = 2
  13. cc.CaseGiveHours = 24
  14. cc.CaseJudgeRadio = 60
  15. cc.CaseLoadMax = 20
  16. cc.CaseLoadSwitch = 1
  17. cc.CaseObtainMax = 100
  18. cc.CaseVoteMax = 50
  19. cc.CaseVoteMin = 50
  20. cc.JuryApplyMax = 200
  21. cc.JuryVoteRadio = 40
  22. err := s.SetCaseConf(context.TODO(), cc)
  23. fmt.Println(cc)
  24. fmt.Println(err)
  25. So(err, ShouldBeNil)
  26. So(cc, ShouldNotBeEmpty)
  27. })
  28. }
  29. func Test_CaseConfig(t *testing.T) {
  30. Convey("return someting", t, func() {
  31. cv := s.CaseConfig(blocked.ConfigCaseGiveHours)
  32. fmt.Println(cv)
  33. So(cv, ShouldNotBeEmpty)
  34. })
  35. }
  36. func Test_VotenumConf(t *testing.T) {
  37. Convey("return someting", t, func() {
  38. cc, err := s.VotenumConf(context.TODO())
  39. fmt.Println(cc)
  40. fmt.Println(err)
  41. So(err, ShouldBeNil)
  42. So(cc, ShouldNotBeEmpty)
  43. })
  44. }
  45. func Test_SetVotenumConf(t *testing.T) {
  46. Convey("return someting", t, func() {
  47. vn := new(blocked.ArgVoteNum)
  48. vn.OID = 1
  49. vn.RateS = 3
  50. vn.RateA = 2
  51. vn.RateB = 1
  52. vn.RateC = 1
  53. vn.RateD = 1
  54. err := s.SetVotenumConf(context.TODO(), vn)
  55. So(err, ShouldBeNil)
  56. })
  57. }