Refactor target charging apis (#5649)
This commit is contained in:
parent
8d805306ff
commit
dcaadb783f
53 changed files with 799 additions and 642 deletions
|
|
@ -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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue