package crontab import ( "fmt" "kpt-pasture/model" "testing" pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow" ) func TestEntry_CalculateScore(t *testing.T) { app := &model.AppPastureList{ Id: 4, Category: pasturePb.PastureCategory_Beef, } habit := &model.NeckActiveHabit{ Id: 5287253, PastureId: 4, NeckRingNumber: "324", CowId: 11246, EarNumber: "210868", Lact: 3, CalvingAge: 312, PenId: 16, ActiveTime: "2025-07-09", Frameid: 7, HeatDate: "2025-07-09 11:00:00", Rumina: 9, Intake: 21, Inactive: 74, Gasp: 0, Other: 0, High: 642, Active: 36, FilterHigh: 974, FilterRumina: 10, FilterChew: 29, WeekHigh: 1112, HighHabit: 1755, RuminaHabit: 23, IntakeHabit: 38, ChewHabit: 49, InactiveHabit: 36, OtherHabit: 0, ChangeHigh: -45, ChangeRumina: -57, ChangeChew: -41, ChangeAdjust: 0, ChangeFilter: 53, RuminaFilter: -57, ChewFilter: -39, FilterCorrect: 95, SumRumina: 129, SumIntake: 106, SumInactive: 456, SumActive: 668, SumMinHigh: -55, SumMaxHigh: 96, SumMinChew: -68, BeforeThreeSumRumina: 508, BeforeThreeSumIntake: 159, Score: 0, IsShow: 1, Cft: 60.35, Voltage: 301, RecordCount: 6, FirmwareVersion: 57, } fmt.Println(CalculateScore(app, habit)) }