Refactor target charging apis (#5649)

This commit is contained in:
andig 2023-01-19 19:01:22 +01:00 • committed by GitHub
parent 8d805306ff
commit dcaadb783f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
53 changed files with 799 additions and 642 deletions

View file

@ -1,29 +0,0 @@
package api
import (
"sort"
"testing"
"time"
"github.com/benbjohnson/clock"
"github.com/stretchr/testify/assert"
)
func TestRatesSortLateSlotsFirst(t *testing.T) {
clock := clock.NewMock()
r := Rates{
{
Price: 1,
Start: clock.Now(),
},
{
Price: 1,
Start: clock.Now().Add(time.Hour),
},
}
sort.Sort(r)
assert.Equal(t, clock.Now().Add(time.Hour), r[0].Start)
assert.Equal(t, clock.Now(), r[1].Start)
}