package store_test

import (
	"testing"

	"github.com/tidbcloud/serverless-metering/pkg/util"
)

func TestLocateLatestOnTheHour(t *testing.T) {
	type args struct {
		ts int64
	}
	tests := []struct {
		name string
		args args
		want int64
	}{
		{
			name: "testParse",
			args: args{
				ts: 1729671982,
			},
			want: 1729670400,
		},
	}
	for _, tt := range tests {
		t.Run(tt.name, func(t *testing.T) {
			if got := util.LocateLatestOnTheHour(tt.args.ts); got != tt.want {
				t.Errorf("LocateLatestOnTheHour() = %v, want %v", got, tt.want)
			}
		})
	}
}
